How majoood143/majalis works
1. Overall shape
- This is a Laravel monolith for a hall/event booking platform.
- The application is split into three user-facing surfaces plus background automation:
- a public/customer booking site,
- an owner portal,
- an admin back office.
- Most business logic lives in Laravel services, Eloquent models, events/listeners, jobs, and Filament resources.
2. Main request entrypoints
- HTTP routing is separated by concern: routes/web.php, routes/customer.php, routes/guest-booking.php, routes/customer-tickets.php, and routes/auth.php.
- Controllers in app/Http/Controllers handle the public/customer flows, while Filament pages/resources handle most CRUD and dashboard interactions for admin/owner users.
- routes/console.php and app/Console/Kernel.php define scheduled/CLI automation.
3. Three application surfaces
- Admin panel: app/Filament/Admin with management pages, dashboards, reports, and CRUD for nearly all domain entities.
- Owner panel: app/Filament/Owner focused on hall owners’ bookings, availability, earnings, expenses, tickets, and performance dashboards.
- Public/customer experience: Blade views and controllers under resources/views/customer and app/Http/Controllers/Customer for browsing halls, booking, payment, tickets, and reviews.
4. Core domain model
- The heart of the system is hall booking. Key entities include Hall, Booking, HallOwner, HallAvailability, Payment, Payout, Review, PromoCode, ExtraService, CommissionSetting, ServiceFeeSetting, Expense, Ticket, Page, and geographic entities like Region and City.
- The many migration files show a mature schema with advanced booking features such as advance payments, guest bookings, seasonal pricing, event types, payout tracking, and service-fee audits.
5. Booking lifecycle
- Booking creation starts in customer/guest controllers or Filament CRUD screens and is validated against availability and hall rules.
- Booking state transitions are represented with enums like BookingStatus, PaymentStatus, and related notification/status enums.
- Booking actions trigger domain events such as BookingApproved and BookingRejected, and there are observer classes for side effects on booking/user changes.
6. Availability and pricing
- Availability is a first-class subsystem: AvailabilityService and owner/admin availability resources manage slot calendars and hall blocking.
- Pricing is layered through PricingResource, SeasonalPricing, commission/service fee settings, and promo codes.
- Owner-facing calendar and pricing tools suggest the system supports operational scheduling, not just static listings.
7. Payments, payouts, and finance
- Payment handling is centralized in services like PaymentService, ThawaniService, InvoiceService, BookingPdfService, PayoutReceiptService, and PDF-related services.
- The presence of config/thawani.php indicates integration with the Thawani payment gateway.
- Financial reporting is split by audience: admin reports, owner earnings, payout management, and receipt/invoice generation, with Filament widgets and PDF views supporting those outputs.
8. Notifications and messaging
- There is a dedicated notification pipeline using Laravel notifications, mailables, and queued jobs.
- Booking, payout, review request, reminder, and ticket notifications are all modeled explicitly in app/Notifications, app/Mail, and app/Jobs.
- WhatsApp is also part of the architecture via WhatsappNotificationService and WhatsApp-related models/policies/migrations, so messaging is multi-channel, not email-only.
9. Asynchronous processing
- Background jobs handle time-sensitive or expensive work: auto-completing bookings, generating invoices, sending reminders, sending notifications, and review requests.
- The app also includes console commands for synchronization, diagnostics, cache/font maintenance, and booking/email checks.
- This means the system depends on queues and scheduled automation for operational correctness, not just synchronous web requests.
10. Guest booking and identity linking
- Guest booking is a dedicated path with its own service provider, controllers, Livewire components, and storage model (GuestSession).
- There are listeners that link guest bookings and tickets to a registered user after account creation.
- This is a key boundary: the system supports anonymous conversion funnels and later account association.
11. Content, support, and CMS-like features
- The app includes pages, static content, and knowledge-base-style admin capabilities: Page, PageResource, PageController, and related views.
- Tickets and ticket messages form a built-in support system for customers and owners.
- Reviews and promo codes add adjacent customer engagement flows around the booking core.
12. Presentation layer and UI framework
- Filament is the main admin/owner UI framework, with many resources, relation managers, widgets, and custom pages.
- Livewire is used for interactive components such as language switching, hall owner registration, and maintenance controls.
- Blade templates under resources/views provide the customer site, emails, invoices, PDFs, and Filament custom views.
13. Internationalization and formatting
- The app is bilingual, with extensive Arabic and English language files across domain areas.
- Arabic-specific assets include a custom font setup and font-cache maintenance commands, which matters for PDF and UI rendering.
- app/Http/Middleware/SetUserLanguage indicates language selection is part of request handling.
14. Infrastructure and cross-cutting concerns
- Authorization is enforced through a rich set of policies and Filament Shield/permission configuration.
- Observers, middleware, and service classes are used to keep controllers and resources thin.
- Reporting/export functionality is centralized in services such as ReportService and DashboardExportService.
15. What to draw as the main architecture boundaries
- At the center: Eloquent models and services around halls, bookings, payments, and payouts.
- On the left: customer/guest web flows and public pages.
- On the right: owner and admin Filament panels.
- Below: queues, scheduled commands, email/PDF/WhatsApp integrations, and payment gateway calls.
- Around everything: policies, middleware, localization, and notification/event infrastructure.
Main entry points: Booking.php Booking Core · routes Routes · Customer Customer HTTP · Admin Admin Panel
Components 20
Application Surfaces
Public customer site, owner portal, and admin back office.
- Routes · Route files split by customer, guest booking, tickets, auth, web, and console concerns.
routes - Customer HTTP · Public and customer-facing controllers for halls, bookings, payments, profiles, promo codes, reviews, and pages.
app/Http/Controllers/Customer - Guest Booking · Anonymous booking flow with its own service provider, Livewire components, and guest session linkage.
app/Providers/GuestBookingServiceProvider.php - Admin Panel · Back-office CRUD, dashboards, reports, settings, and management pages.
app/Filament/Admin - Owner Panel · Owner-facing booking, availability, pricing, earnings, expenses, tickets, and performance tools.
app/Filament/Owner
Domain Core
Booking, halls, payments, pricing, finance, and support data models.
- Hall Models · Halls, owners, regions, cities, features, images, categories, types, and availability.
app/Models/Hall.php - Booking Core · Bookings, payments, payouts, reviews, promo codes, guest sessions, and booking notifications.
app/Models/Booking.php - Pricing & Finance · Availability, booking, pricing, commission, payment, invoice, PDF, payout receipt, promo code, and reporting services.
app/Services/BookingService.php - Support & Content · Pages, tickets, ticket messages, and related customer support/content entities.
app/Models/Page.php - Domain Enums · Booking, payment, payout, notification, expense, recurrence, time-slot, and user role states.
app/Enums
Automation
Queues, jobs, listeners, events, and scheduled commands.
- Events & Listeners · Booking approval/rejection events and registration listeners that link guest data to users.
app/Events - Jobs & Queue · Invoice generation, reminders, notifications, review requests, and auto-completion work.
app/Jobs - Scheduler · Scheduled commands and maintenance tasks for booking sync, font cache, diagnostics, and cleanup.
app/Console/Kernel.php - Notifications · Laravel notifications, mailables, and WhatsApp notification services for booking and payout flows.
app/Services/WhatsappNotificationService.php
Presentation
Blade, Filament UI, Livewire, and localization assets.
- Filament Support · Shared Filament services, traits, components, pages, widgets, and custom views.
app/Filament - Customer Views · Public customer, guest booking, invoices, emails, PDFs, and support-facing Blade templates.
resources/views/customer - Localization · Arabic and English translations plus RTL/font assets and language switching support.
resources/lang
Infrastructure
Policies, middleware, providers, and external integrations.
- Access Control · Authentication, owner gating, language selection, Filament session checks, and authorization policies.
app/Policies - Providers · Application, event, Filament panel, and guest-booking providers wiring the app together.
app/Providers - External Integrations · Thawani payment gateway, mail, queue, filament plugins, PDF rendering, and WhatsApp-related config.
config/thawani.php
Connections 28
- Routes → Customer HTTP: dispatches · Web and customer routes lead into controllers.
- Routes → Guest Booking: guest flows · Dedicated guest booking routes use the guest booking provider and components.
- Routes → Admin Panel: admin UI · Admin route surface is handled by Filament resources and pages.
- Routes → Owner Panel: owner UI · Owner route surface is handled by Filament owner resources and pages.
- Customer HTTP → Hall Models: reads/writes · Customer flows browse and update hall data and availability.
- Customer HTTP → Booking Core: creates bookings · Booking, payment, ticket, review, and profile flows touch booking entities.
- Guest Booking → Booking Core: guest records · Anonymous bookings and guest sessions are stored and later linked.
- Admin Panel → Hall Models: manages · Admin CRUD spans halls, regions, cities, media, and availability.
- Admin Panel → Booking Core: manages · Admin manages bookings, payments, payouts, reviews, promo codes, and tickets.
- Owner Panel → Hall Models: operates · Owners manage their halls, galleries, features, pricing, and availability.
- Owner Panel → Booking Core: tracks · Owners review bookings, earnings, expenses, payouts, and support tickets.
- Hall Models → Pricing & Finance: used by · Availability and booking logic depend on pricing, commission, and payment services.
- Booking Core → Pricing & Finance: processed by · Bookings flow through payment, invoice, PDF, payout, and reporting services.
- Booking Core → Domain Enums: stateful · Bookings, payments, payouts, and notifications rely on enums for workflow states.
- Booking Core → Events & Listeners: emits · Booking state changes trigger approval/rejection events and guest-link listeners.
- Events & Listeners → Jobs & Queue: queues work · Listeners and domain events trigger queued notifications and follow-up jobs.
- Jobs & Queue → Notifications: sends · Queued work delivers mail, notifications, reminders, and WhatsApp messages.
- Scheduler → Jobs & Queue: orchestrates · Console commands schedule automation around booking sync, cleanup, and diagnostics.
- Filament Support → Admin Panel: powers · Filament resources, widgets, and pages implement the admin experience.
- Filament Support → Owner Panel: powers · Filament resources, widgets, and pages implement the owner experience.
- Customer Views → Customer HTTP: renders · Blade views support the public and customer controllers.
- Localization → Customer Views: translates · UI text, emails, PDFs, and customer screens are bilingual.
- Localization → Filament Support: translates · Filament panels and custom widgets use localized labels and content.
- Access Control → Routes: guards · Middleware and policies gate the routed application surfaces.
- Providers → Routes: registers · Service providers register panels, guest booking, and app wiring.
- Providers → Filament Support: boots · Panel providers bootstrap the Filament admin and owner surfaces.
- External Integrations → Pricing & Finance: connects · Payment gateway, PDF, mail, and report integrations back the core services.
- External Integrations → Notifications: supports · Email and messaging channels depend on configured transports and APIs.