How hutagalung12/uasyuda works
Purpose and Entry Points
This is a Laravel application for managing sports-field (“lapangan”) inventory and reservations, including payment-proof upload and reservation reporting. HTTP traffic enters through public/index.php, is bootstrapped by bootstrap/app.php, and is split into browser routes in routes/web.php and token-oriented API routes in routes/api.php.
HTTP Delivery Surfaces
The server-rendered application uses controllers and Blade views for authentication, field administration, reservations, and reports:
• app/Http/Controllers/AuthController.php
• app/Http/Controllers/LapanganController.php
• app/Http/Controllers/ReservasiController.php
• resources/views/lapangans/index.blade.php
• resources/views/reservasis/index.blade.php
A parallel API surface exposes authentication and field operations through:
• app/Http/Controllers/Api/AuthController.php
• app/Http/Controllers/Api/LapanganController.php
• routes/api.php
Identity and Authorization Boundary
Users are persisted through the application user model and schema, with Laravel authentication configuration and Sanctum available for API token authentication:
• app/Models/User.php
• config/auth.php
• config/sanctum.php
• database/migrations/2026_07_16_074008_create_personal_access_tokens_table.php
Role-based access is an explicit middleware boundary in app/Http/Middleware/CheckRole.php. Route middleware determines which actors may administer fields, create/manage reservations, or access reports.
Core Reservation Domain
The principal domain entities are fields and reservations:
• app/Models/Lapangan.php
• app/Models/Reservasi.php
• database/migrations/2026_07_16_074117_create_lapangans_table.php
• database/migrations/2026_07_16_074117_create_reservasis_table.php
The expected flow is: a user selects a field, submits reservation data, the controller persists a Reservasi linked to the selected Lapangan, and staff or users can inspect reservation listings. Request validation forms establish the input boundary before controller/domain persistence:
• app/Http/Requests/StoreReservasiRequest.php
• app/Http/Requests/StoreLapanganRequest.php
• app/Http/Requests/UpdateLapanganRequest.php
Payment Proof and File Storage
Reservation payment evidence is handled as a separate upload step, rather than embedded only in reservation creation:
• app/Http/Requests/UploadBuktiRequest.php
• resources/views/reservasis/upload-bukti.blade.php
• app/Http/Controllers/ReservasiController.php
Uploaded files cross into Laravel’s configured filesystem abstraction (config/filesystems.php) and application storage (storage/app/public or storage/app/private). This is a material boundary for validation, access control, URL exposure, and retention of payment documents.
Presentation, API Serialization, and Reporting
Browser responses are rendered from Blade templates under resources/views, while API field responses are normalized by:
• app/Http/Resources/LapanganResource.php
• resources/views/layouts/app.blade.php
Reporting is owned by a dedicated controller and a reservation PDF-oriented view:
• app/Http/Controllers/LaporanController.php
• resources/views/laporan/reservasi-pdf.blade.php
This separates operational CRUD pages from a report-generation path that likely transforms reservation data into a printable/downloadable document.
Runtime and Infrastructure
The runtime is PHP/Laravel with Composer dependencies (composer.json), Eloquent-backed database configuration (config/database.php), and standard Laravel cache, session, queue, mail, and logging integration:
• config/cache.php
• config/session.php
• config/queue.php
• config/logging.php
The repository also includes a Vite-managed frontend asset entry (resources/js/app.js, vite.config.js). Database migrations define users, fields, reservations, personal tokens, cache, and jobs, enabling either relational database-backed operational state and optional queued work.
Main entry points: web.php Browser routes · ReservasiController.php Reservation controller · Reservasi.php Reservation · Lapangan.php Sports field
Components 20
Laravel Runtime
- HTTP entry
public/index.php - Application bootstrap
bootstrap/app.php
HTTP Surfaces
- Browser users
- API clients · Token-oriented consumers.
- Browser routes
routes/web.php - API routes
routes/api.php - Auth and role gate · Authenticates users and restricts route actions by role.
app/Http/Middleware/CheckRole.php
Reservation Domain
- Reservation controller · Creates, lists, and accepts payment proof for reservations.
app/Http/Controllers/ReservasiController.php - Field administration
app/Http/Controllers/LapanganController.php - Field API · Serves token-authenticated field operations.
app/Http/Controllers/Api/LapanganController.php - Reservation input validation · Validates reservation creation and proof uploads.
app/Http/Requests/StoreReservasiRequest.php - Reservation · Links a booking to its selected field and payment evidence.
app/Models/Reservasi.php - Sports field
app/Models/Lapangan.php - User identity · Authenticated users and API token owners.
app/Models/User.php
Delivery & Reporting
- Blade pages · Operational field and reservation pages.
resources/views/reservasis/index.blade.php - Field API serializer
app/Http/Resources/LapanganResource.php - Reservation reporting · Builds printable reservation reports.
app/Http/Controllers/LaporanController.php - Reservation PDF view
resources/views/laporan/reservasi-pdf.blade.php
State & Storage
- Relational database · Persists users, fields, reservations, and personal access tokens.
config/database.php - Payment document storage · Stores uploaded payment proof in configured application disks.
config/filesystems.php
Connections 26
- Browser users → HTTP entry: HTTP requests
- API clients → HTTP entry: API requests
- HTTP entry → Application bootstrap: boots
- Application bootstrap → Browser routes: registers
- Application bootstrap → API routes: registers
- Browser routes → Auth and role gate: applies auth/roles
- API routes → Auth and role gate: token auth and roles
- Auth and role gate → User identity: resolves user
- User identity → Relational database: persists
- Browser routes → Reservation controller: dispatches
- Browser routes → Field administration: dispatches
- API routes → Field API: dispatches
- Reservation controller → Reservation input validation: validates input
- Reservation input validation → Reservation: accepted booking data
- Reservation controller → Reservation: creates and lists
- Reservation controller → Payment document storage: stores payment proof
- Reservation → Sports field: belongs to
- Reservation → Relational database: persists
- Sports field → Relational database: persists
- Reservation controller → Blade pages: renders
- Field administration → Sports field: manages
- Field API → Sports field: queries and manages
- Field API → Field API serializer: serializes
- Browser routes → Reservation reporting: dispatches reports
- Reservation reporting → Reservation: reads reservations
- Reservation reporting → Reservation PDF view: renders