How alberttobing0311-web/uasalbert24 works
Purpose and Entry Points
This is a Laravel application for managing sports-field (Lapangan) inventory and customer reservations (Reservasi), including payment-proof upload and reservation reporting. HTTP traffic enters through public/index.php, boots via bootstrap/app.php, and is divided between browser routes in routes/web.php and token-oriented API routes in routes/api.php.
Web Application Flow
Server-rendered workflows are handled by MVC controllers:
• Authentication: app/Http/Controllers/AuthController.php
• Field management: app/Http/Controllers/LapanganController.php
• Reservation creation/listing and proof upload: app/Http/Controllers/ReservasiController.php
• Reservation reports/PDF view: app/Http/Controllers/LaporanController.php
Controllers render Blade views under resources/views/, notably field screens in resources/views/lapangans/, reservation screens in resources/views/reservasis/, and the report template resources/views/laporan/reservasi-pdf.blade.php.
API Boundary
A parallel API surface is implemented separately from the browser controllers:
• app/Http/Controllers/Api/AuthController.php
• app/Http/Controllers/Api/LapanganController.php
• routes/api.php
Laravel Sanctum is configured at config/sanctum.php, and personal-access-token schema support is present in database/migrations/2026_07_16_074008_create_personal_access_tokens_table.php. app/Http/Resources/LapanganResource.php defines an explicit API representation boundary for field records.
Domain and Persistence
The core domain is represented by Eloquent models:
• app/Models/User.php
• app/Models/Lapangan.php
• app/Models/Reservasi.php
Database structure is managed through migrations, especially database/migrations/2026_07_16_074117_create_lapangans_table.php and database/migrations/2026_07_16_074117_create_reservasis_table.php. The primary data flow is user/authentication context → field selection and reservation submission → persisted reservation/payment evidence → listing or report output.
Validation and Authorization
Request-level validation is separated from controllers for state-changing operations:
• app/Http/Requests/StoreLapanganRequest.php
• app/Http/Requests/UpdateLapanganRequest.php
• app/Http/Requests/StoreReservasiRequest.php
• app/Http/Requests/UploadBuktiRequest.php
Role enforcement is centralized in app/Http/Middleware/CheckRole.php, forming the authorization boundary for administrative or role-specific routes. Authentication behavior is configured in config/auth.php.
Files, Reports, and Runtime Services
Payment-proof upload is a material storage boundary, with Laravel filesystem configuration in config/filesystems.php and storage roots under storage/app/private/ and storage/app/public/. Reporting is represented by LaporanController and a dedicated PDF-oriented Blade template rather than a separate reporting service.
The runtime is PHP/Laravel (artisan, composer.json) with configurable database, cache, session, queue, mail, logging, and filesystem backends in config/database.php, config/cache.php, config/queue.php, and related configuration. Queue/cache/job migrations are included, but no application-specific job classes are present in the tree.
Front-End Delivery
The browser UI is Blade-first, with a shared layout at resources/views/layouts/app.blade.php. Vite-managed client assets originate from resources/js/app.js and resources/css/app.css, configured by vite.config.js; these support the server-rendered reservation and management workflows rather than indicating a separate SPA.
Main entry points: ReservasiController.php Reservation controllers · app.php Application bootstrap · web.php Web routes · api.php API routes
Components 17
Laravel Runtime
- HTTP entry
public/index.php - Application bootstrap
bootstrap/app.php
Browser MVC
- Web routes
routes/web.php - Role enforcement · Guards administrative and role-specific routes.
app/Http/Middleware/CheckRole.php - Reservation controllers · Handles authentication, fields, reservations, uploads, and reports.
app/Http/Controllers/ReservasiController.php - Validated requests · Validates field, reservation, and proof-upload mutations.
app/Http/Requests/StoreReservasiRequest.php - Blade UI · Shared layout and field/reservation screens.
resources/views/layouts/app.blade.php - PDF report template
resources/views/laporan/reservasi-pdf.blade.php - Client assets · Enhances the Blade-first interface.
resources/js/app.js
Token API
- API routes
routes/api.php - API controllers · Separate authentication and field API surface.
app/Http/Controllers/Api/LapanganController.php - Sanctum tokens
config/sanctum.php - Field representation · Explicit response boundary for field records.
app/Http/Resources/LapanganResource.php
Domain & Persistence
- Core models · Users, fields, and reservations.
app/Models/Reservasi.php - Application database · Stores users, fields, reservations, and access tokens.
database/migrations/2026_07_16_074117_create_reservasis_table.php - Payment-proof storage · Private and public storage roots hold uploaded evidence.
storage/app/private - Filesystem config
config/filesystems.php
Connections 19
- HTTP entry → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → API routes: loads
- Web routes → Role enforcement: applies
- Role enforcement → Reservation controllers: authorizes
- Web routes → Reservation controllers: dispatches
- Reservation controllers → Validated requests: uses
- Reservation controllers → Core models: reads and writes
- Reservation controllers → Blade UI: renders
- Reservation controllers → PDF report template: renders report
- Reservation controllers → Payment-proof storage: uploads proof
- Client assets → Blade UI: supports
- API routes → Sanctum tokens: authenticates with
- API routes → API controllers: dispatches
- Sanctum tokens → Application database: stores tokens
- API controllers → Core models: queries
- API controllers → Field representation: serializes
- Core models → Application database: persists
- Filesystem config → Payment-proof storage: configures