How triandhinimartysitumeang-max/uas_017 works
Purpose and Entry Points
This is a Laravel server-rendered application for managing sports fields (“lapangan”) and reservations (“reservasi”), with user authentication and an admin role boundary. HTTP enters through public/index.php, boots Laravel via bootstrap/app.php, and dispatches browser routes in routes/web.php. artisan is the CLI entry point for migrations, seeding, and framework operations.
HTTP and Presentation Layer
Route handlers are conventional MVC controllers. app/Http/Controllers/HomeController.php serves the main application area; app/Http/Controllers/LapanganController.php and app/Http/Controllers/ReservasiController.php implement field and reservation workflows. Responses are Blade-rendered HTML, with layouts and feature views under resources/views/layouts/app.blade.php, resources/views/lapangan/, and resources/views/reservasi/. Reservations also have a dedicated printable/PDF-oriented view at resources/views/reservasi/pdf.blade.php.
Authentication and Authorization
Laravel authentication is implemented through the standard auth controller set in app/Http/Controllers/Auth/, covering registration, login, password reset/confirmation, and email verification. There is also an application-level login controller at app/Http/Controllers/LoginController.php, so route ownership should be checked before changing login behavior. Admin-only access is enforced by app/Http/Middleware/AdminMiddleware.php; user roles are persisted through database/migrations/2026_07_16_072122_add_role_to_users_table.php.
Core Domain and Persistence
The core entities are Eloquent models app/Models/User.php, app/Models/Lapangan.php, and app/Models/Reservasi.php. Their schema is created by database/migrations/0001_01_01_000000_create_users_table.php, database/migrations/2026_07_16_071924_create_lapangans_table.php, and database/migrations/2026_07_16_072023_create_reservasis_table.php. Primary flow is: authenticated user selects or manages a field, submits reservation data, controller validates/persists it, then renders reservation listings, edit forms, or the PDF view.
Validation and Domain Boundary
Field create/update input is isolated in app/Http/Requests/LapanganRequest.php, separating request validation from LapanganController. Reservation validation appears controller-owned because no reservation request object exists in the tree. The controllers are therefore the principal boundary between HTTP/session state, Eloquent persistence, and rendered views.
Runtime, State, and Infrastructure
The application runs on PHP/Laravel with Composer dependencies (composer.json) and a database configured by config/database.php. Laravel cache, session, and queue abstractions are configured in config/cache.php, config/session.php, and config/queue.php; migrations include framework cache and jobs tables. Mail/auth password-reset behavior is configured through config/mail.php and config/auth.php. Persistent and generated runtime artifacts use storage/app/, storage/framework/, and storage/logs/.
Front-End Asset Pipeline
Blade pages consume compiled application assets sourced from resources/css/app.css, resources/js/app.js, and resources/sass/app.scss. Vite is the asset build boundary via vite.config.js and package.json; it is not a separate frontend application.
Main entry points: HomeController.php Application controllers · app.php Laravel bootstrap · web.php Browser routes · User.php Core Eloquent models
Components 18
Entry Points
- Web entry
public/index.php - Laravel bootstrap
bootstrap/app.php - Artisan CLI · Runs migrations, seeding, and framework commands.
artisan
HTTP Application
- Browser routes
routes/web.php - Application controllers · Home, field, and reservation request workflows.
app/Http/Controllers/HomeController.php - Field validation
app/Http/Requests/LapanganRequest.php - Auth controllers · Registration, login, reset, confirmation, and verification.
app/Http/Controllers/Auth/LoginController.php - Admin role guard
app/Http/Middleware/AdminMiddleware.php - Blade views · Layouts plus field and reservation pages.
resources/views/layouts/app.blade.php - Reservation print view
resources/views/reservasi/pdf.blade.php
Domain & Persistence
- Core Eloquent models · User, Lapangan, and Reservasi entities.
app/Models/User.php - Schema migrations · Creates users, fields, reservations, roles, cache, and jobs tables.
database/migrations/2026_07_16_072023_create_reservasis_table.php
Runtime Infrastructure
- Application database
config/database.php - Framework state · Laravel abstractions with backing tables and runtime storage.
config/session.php - Auth and mail config · Configures guards, password resets, and mail delivery.
config/auth.php - Runtime storage · Application files, framework state, and logs.
storage/app/.gitignore
Asset Pipeline
- Vite build · Builds application CSS and JavaScript; not a separate frontend app.
vite.config.js - Asset sources
resources/js/app.js
Connections 19
- Web entry → Laravel bootstrap: boots
- Laravel bootstrap → Browser routes: dispatches
- Browser routes → Auth controllers: auth routes
- Browser routes → Admin role guard: protects admin routes
- Browser routes → Application controllers: dispatches
- Admin role guard → Application controllers: authorizes
- Application controllers → Field validation: validates fields
- Application controllers → Core Eloquent models: reads and persists
- Auth controllers → Core Eloquent models: manages users
- Application controllers → Blade views: renders
- Application controllers → Reservation print view: renders printable reservation
- Core Eloquent models → Application database: Eloquent persistence
- Schema migrations → Application database: creates schema
- Artisan CLI → Schema migrations: runs
- Laravel bootstrap → Framework state: configures
- Framework state → Runtime storage: uses runtime artifacts
- Laravel bootstrap → Auth and mail config: loads
- Asset sources → Vite build: compiled by
- Vite build → Blade views: supplies compiled assets