Developer Menu 3/4
3. Laravel Project Structure for Developers
Understanding the project structure is crucial for efficient development and customization.
Directory Overview
web/
├── app/
│ ├── Constant/ # Enums/constants used across modules
│ ├── Contracts/ # Interface contracts
│ ├── Factory/ # Factory classes (e.g., payment gateway resolution)
│ ├── Filters/ # Query filters (API/event filtering)
│ ├── Gateways/ # Gateway integration classes
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Api/ # API controllers for mobile app
│ │ │ ├── Auth/ # Authentication controllers
│ │ │ ├── Backend/ # Admin panel controllers
│ │ │ ├── Organizer/ # Organizer-specific controllers
│ │ │ └── User/ # User management controllers
│ │ ├── Middleware/ # Custom middleware aliases and guards
│ │ └── Requests/ # Form request validation
│ ├── Models/ # Eloquent models
│ ├── Services/ # Business logic services
│ ├── Sections/ # Dynamic section/builder support
│ └── Traits/ # Reusable traits
├── bootstrap/
│ └── app.php # Route registration + middleware aliases
├── database/
│ ├── migrations/ # Database schema migrations
│ └── seeders/ # Database seeders
├── routes/
│ ├── api.php # API routes (mobile app)
│ ├── web.php # Web routes (frontend)
│ ├── admin.php # Admin panel routes
│ ├── organizer.php # Organizer routes
│ ├── installer.php # Installer routes
│ └── console.php # Artisan/console route definitions
├── resources/
│ ├── views/
│ │ ├── backend/ # Admin panel views
│ │ ├── frontend/ # Frontend views
│ │ ├── organizer/ # Organizer panel views
│ │ ├── gateways/ # Gateway checkout views
│ │ └── components/ # Blade components
│ └── lang/ # Language files
└── config/ # Configuration files
Key Controllers
API Controllers (app/Http/Controllers/Api/)
RegistrationController.php- User authenticationEventController.php- Event managementPurchaseController.php- Ticket purchasingCommonApiController.php- Shared API functionality
Backend Controllers (app/Http/Controllers/Backend/)
Dashboard/DashboardController.php- Admin dashboardUsers/ManageUserController.php- User managementOrganizer/OrganizerController.php- Organizer managementVolunteer/VolunteerController.php- Volunteer managementSettings/SettingsController.php- System settings
Models (app/Models/)
Key models with their relationships:
User.php- User model with organizer capabilitiesEvent.php- Event model with ticket relationshipsEventTicketType.php- Ticket types for eventsTicketPurchase.php- Purchase recordsTransaction.php- Financial transactions
Services (app/Services/)
Business logic separation:
Register/RegisterService.php- User registration logicGateway/- Gateway configuration and gateway-level service logicEventOrganizer/- Organizer event/volunteer operationsPasswordReset/PasswordResetService.php- Password reset functionality
Routes Organization
Route files are registered in bootstrap/app.php. Admin, organizer, and installer routes are attached with explicit URL prefixes there.
API Routes (routes/api.php)
- Public endpoints for event browsing
- Authentication endpoints
- Protected endpoints for authenticated users
- Volunteer-specific endpoints
Admin Routes (routes/admin.php)
- Admin panel functionality
- User management
- Event moderation
- System settings
Organizer Routes (routes/organizer.php)
- Event creation and management
- Ticket sales monitoring
- Customer communication
Installer Routes (routes/installer.php)
- Installation wizard and environment/database setup
- Guarded by installation middleware
Configuration Files
Key configuration files:
config/app.php- Application settingsconfig/database.php- Database configurationconfig/sanctum.php- API token authentication settingsconfig/services.php- Third-party service settings.env- Environment-specific settings
Where to Edit Common Features
- New endpoint:
routes/*+ controller - New validation:
app/Http/Requests - Business rules:
app/Services - Data relation/fields:
app/Models+ migrations - Admin UI:
resources/views/backend - Organizer UI:
resources/views/organizer
Route Prefixes
/apifromroutes/api.php/adminmapped inbootstrap/app.phptoroutes/admin.php/organizermapped inbootstrap/app.phptoroutes/organizer.php/installermapped inbootstrap/app.phptoroutes/installer.php