How sitohangagnesia086-svg/uas_224520002 works
Purpose and Entry Points
This is a Laravel/PHP application for managing sports fields (“lapangan”) and reservations (“reservasi”), with separate administrator/member dashboards, browser pages, and an API surface. HTTP requests enter through public/index.php, bootstrap via bootstrap/app.php, and are dispatched by routes/web.php or routes/api.php.
Web Application Layer
Server-rendered browser workflows are organized around controllers and Blade templates:
• Authentication: app/Http/Controllers/AuthController.php, resources/views/auth/login.blade.php, resources/views/auth/register.blade.php
• Dashboards: app/Http/Controllers/DashboardController.php, resources/views/dashboard/admin.blade.php, resources/views/dashboard/member.blade.php
• Field and reservation pages: app/Http/Controllers/LapanganController.php, app/Http/Controllers/ReservasiController.php, resources/views/reservasi/index.blade.php
The shared layout boundary is resources/views/layouts/app.blade.php.
API Boundary
A separate API route surface is defined in routes/api.php, with dedicated API controllers:
• app/Http/Controllers/Api/AuthController.php
• app/Http/Controllers/Api/LapanganController.php
Sanctum configuration at config/sanctum.php and the personal-access-token migration at database/migrations/2026_07_16_072718_create_personal_access_tokens_table.php indicate token-based API authentication capability, distinct from browser session flows.
Identity, Authorization, and Roles
Users are represented by app/Models/User.php and persisted through database/migrations/0001_01_01_000000_create_users_table.php. A role extension is introduced in database/migrations/2026_07_16_070214_add_role_to_users_table.php; role enforcement is centralized in app/Http/Middleware/RoleMiddleware.php. This is the principal authorization boundary separating administrative field-management/dashboard capabilities from member reservation use.
Core Domain and Persistence
The main relational domain is:
• Fields: app/Models/Lapangan.php, database/migrations/2026_07_16_070213_create_lapangans_table.php
• Reservations: app/Models/Reservasi.php, database/migrations/2026_07_16_070214_create_reservasis_table.php
• Transfer-proof support: database/migrations/2026_07_16_075626_add_bukti_transfer_to_reservasis_table.php
Controllers coordinate request-to-model operations; migrations define the durable schema boundary. Development/bootstrap data is supplied by database/seeders/DatabaseSeeder.php and database/seeders/UserSeeder.php.
Reservation and Payment-Document Flow
Reservation creation and listing are handled by app/Http/Controllers/ReservasiController.php and rendered through resources/views/reservasi/create.blade.php and resources/views/reservasi/index.blade.php. The bukti_transfer schema addition suggests reservation records can carry transfer-proof evidence. The dedicated resources/views/reservasi/pdf.blade.php is a document-rendering boundary for reservation output, likely intended for PDF generation.
Validation, Storage, and Runtime Infrastructure
Field write operations use dedicated validation requests: app/Http/Requests/StoreLapanganRequest.php and app/Http/Requests/UpdateLapanganRequest.php. Laravel filesystem configuration lives in config/filesystems.php; managed storage roots include storage/app/private and storage/app/public, relevant for uploaded transfer proofs or generated documents.
The runtime is Laravel with Composer-managed PHP dependencies (composer.json) and Vite-managed frontend assets (package.json, vite.config.js). Database, sessions, cache, queues, mail, logging, and authentication are environment-configurable through config/database.php, config/session.php, config/queue.php, config/mail.php, and config/auth.php; no concrete external provider is identified in the supplied repository metadata.
Main entry points: web.php Web routes · Reservasi.php Reservations · User.php Users and roles · Lapangan.php Sports fields
Components 21
HTTP entry and surfaces
- Laravel entrypoint
public/index.php - Application bootstrap
bootstrap/app.php - Web routes
routes/web.php - API routes
routes/api.php
Browser application
- Browser auth
app/Http/Controllers/AuthController.php - Role dashboards
app/Http/Controllers/DashboardController.php - Field management
app/Http/Controllers/LapanganController.php - Reservations · Creates and lists reservations.
app/Http/Controllers/ReservasiController.php - Shared Blade layout
resources/views/layouts/app.blade.php - Reservation pages · Creation, listing, and PDF document rendering.
resources/views/reservasi/create.blade.php - Role enforcement · Separates administrator and member capabilities.
app/Http/Middleware/RoleMiddleware.php - Field validation · Validates field create and update writes.
app/Http/Requests/StoreLapanganRequest.php
Token API
- API authentication
app/Http/Controllers/Api/AuthController.php - Field API
app/Http/Controllers/Api/LapanganController.php - Sanctum tokens · Supports personal-access-token API authentication.
config/sanctum.php
Domain and persistence
- Users and roles
app/Models/User.php - Sports fields
app/Models/Lapangan.php - Reservations · Can carry transfer-proof evidence.
app/Models/Reservasi.php - Relational schema · Users, roles, fields, reservations, transfer proofs, and API tokens.
database/migrations/2026_07_16_070213_create_lapangans_table.php - Managed file storage · Stores uploaded proofs or generated documents.
config/filesystems.php - Bootstrap data
database/seeders/DatabaseSeeder.php
Connections 29
- Laravel entrypoint → Application bootstrap: boots
- Application bootstrap → Web routes: loads
- Application bootstrap → API routes: loads
- Web routes → Browser auth: dispatches
- Web routes → Role dashboards: dispatches
- Web routes → Field management: dispatches
- Web routes → Reservations: dispatches
- Web routes → Role enforcement: protects routes with
- Role enforcement → Users and roles: checks role on
- Browser auth → Users and roles: authenticates
- Role dashboards → Shared Blade layout: renders within
- Field management → Field validation: validates through
- Field validation → Sports fields: guards writes to
- Field management → Sports fields: manages
- Reservations → Reservations: creates and lists
- Reservations → Reservation pages: renders
- Reservation pages → Shared Blade layout: uses
- Reservations → Sports fields: books
- Reservations → Users and roles: belongs to
- Reservations → Managed file storage: stores transfer proof in
- API routes → API authentication: dispatches
- API routes → Field API: dispatches
- API authentication → Sanctum tokens: issues tokens via
- Field API → Sports fields: serves
- Users and roles → Relational schema: persists in
- Sports fields → Relational schema: persists in
- Reservations → Relational schema: persists in
- Sanctum tokens → Relational schema: uses token table
- Bootstrap data → Users and roles: seeds