How robbytarigan327/uas224520003 works
Purpose and Entry Points
This is a Laravel application for managing lapangan (venues/courts) and their reservations, with both server-rendered web workflows 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 Flow
Browser-facing controllers implement authentication, venue management, reservation creation/listing, payment-proof upload, and reservation reporting:
• app/Http/Controllers/AuthController.php
• app/Http/Controllers/LapanganController.php
• app/Http/Controllers/ReservasiController.php
• app/Http/Controllers/LaporanController.php
These controllers render Blade pages under resources/views/, including venue and reservation CRUD screens plus a PDF-oriented reservation report at resources/views/laporan/reservasi-pdf.blade.php.
API Boundary
A parallel API controller layer exposes authentication and venue operations independently of the Blade UI:
• routes/api.php
• app/Http/Controllers/Api/AuthController.php
• app/Http/Controllers/Api/LapanganController.php
app/Http/Resources/LapanganResource.php is the response-shaping boundary for venue API payloads. Sanctum is materially present for token authentication through config/sanctum.php and database/migrations/2026_07_16_074008_create_personal_access_tokens_table.php.
Domain and Persistence
The core relational domain is users, venues, and reservations:
• app/Models/User.php
• app/Models/Lapangan.php
• app/Models/Reservasi.php
Schema ownership is captured in database/migrations/0001_01_01_000000_create_users_table.php, database/migrations/2026_07_16_074117_create_lapangans_table.php, and database/migrations/2026_07_16_074117_create_reservasis_table.php. Eloquent models form the application/data-store boundary; the database backend is environment-configured in config/database.php.
Authorization and Request Validation
Role-based access is enforced by custom middleware:
• app/Http/Middleware/CheckRole.php
• routes/web.php
• routes/api.php
Mutation inputs are separated into Form Requests, establishing validation boundaries before controller/domain handling:
• app/Http/Requests/StoreLapanganRequest.php
• app/Http/Requests/StoreReservasiRequest.php
• app/Http/Requests/UploadBuktiRequest.php
The upload request indicates reservations can carry uploaded proof (bukti), with filesystem behavior controlled by config/filesystems.php and storage rooted at storage/app/.
Reporting and Output
Reservation reporting is a distinct output path rather than ordinary CRUD, coordinated by app/Http/Controllers/LaporanController.php and the report template resources/views/laporan/reservasi-pdf.blade.php. This is the likely boundary for generating a printable/PDF reservation report; the concrete PDF library is not identifiable from the provided tree.
Runtime and Infrastructure
The runtime is PHP/Laravel, managed through artisan and Composer (composer.json). Laravel’s configured infrastructure includes database, cache, sessions, mail, logging, queueing, and filesystems under config/. Database migrations also provision cache and jobs tables, making database-backed cache/queue operation available:
• database/migrations/0001_01_01_000001_create_cache_table.php
• database/migrations/0001_01_01_000002_create_jobs_table.php
Frontend assets are built with Vite from resources/js/ and resources/css/, configured by vite.config.js.
Main entry points: ReservasiController.php Web Controllers · api.php API Routes · app.php Laravel Bootstrap · LapanganController.php API Controllers
Components 18
Laravel Runtime
- HTTP Entry
public/index.php - Laravel Bootstrap
bootstrap/app.php - Frontend Assets
resources/js/app.js
Web Workflow
- Browser
- Web Routes
routes/web.php - Web Controllers · Auth, venue, reservation, and reporting workflows.
app/Http/Controllers/ReservasiController.php - Mutation Validation · Validates venue, reservation, and proof-upload inputs.
app/Http/Requests/StoreReservasiRequest.php - Role Authorization
app/Http/Middleware/CheckRole.php - Blade UI · Venue and reservation CRUD pages.
resources/views/reservasis/index.blade.php - Reservation Report
resources/views/laporan/reservasi-pdf.blade.php
API Surface
- API Routes
routes/api.php - API Controllers · Authentication and venue operations.
app/Http/Controllers/Api/LapanganController.php - Sanctum Tokens
config/sanctum.php - Venue API Resource
app/Http/Resources/LapanganResource.php
Domain & Storage
- Eloquent Domain · Users, venues, and reservations.
app/Models/Reservasi.php - Relational Database
config/database.php - Schema Migrations · Provisions users, venues, reservations, cache, jobs, and token tables.
database/migrations/2026_07_16_074117_create_reservasis_table.php - Proof Storage · Stores uploaded reservation proof files.
storage/app/public
Connections 20
- Browser → HTTP Entry: HTTP requests
- HTTP Entry → Laravel Bootstrap: bootstraps
- Laravel Bootstrap → Web Routes: dispatches web
- Laravel Bootstrap → API Routes: dispatches API
- Web Routes → Role Authorization: enforces roles
- Role Authorization → Web Controllers: authorizes
- Web Controllers → Mutation Validation: validates mutations
- Web Controllers → Eloquent Domain: manages domain
- Web Controllers → Blade UI: renders
- Web Controllers → Reservation Report: generates report
- Mutation Validation → Proof Storage: accepts bukti upload
- API Routes → Role Authorization: enforces roles
- API Routes → Sanctum Tokens: authenticates tokens
- API Routes → API Controllers: dispatches
- API Controllers → Eloquent Domain: manages domain
- API Controllers → Venue API Resource: shapes responses
- Sanctum Tokens → Relational Database: stores tokens
- Eloquent Domain → Relational Database: persists
- Schema Migrations → Relational Database: defines schema
- Frontend Assets → Blade UI: built for UI