How lasains/uas_pemrograman_lanjut works
This Laravel/Inertia café inventory system supports role-based operations across ingredient and batch management, FEFO-guided stock use, waste approval, and owner analytics. The principal workflow runs from staff through routed controllers and domain records to Inertia pages; batch expiry and valuation rules support monitoring and prioritization. Several controllers and views are represented from the tree and README rather than sampled implementation, so those relationships are shown only where routing or documentation supports them.
Main entry points: web.php Application routes · IngredientBatchController.php Batch management · StockUsageController.php Stock usage · DashboardController.php Role dashboards
Components 26
Inventory operations
- Ingredient catalog
app/Http/Controllers/IngredientController.php - Category management
app/Http/Controllers/CategoryController.php - Batch management
app/Http/Controllers/IngredientBatchController.php - FEFO expiry rules
app/Models/IngredientBatch.php - Stock usage
app/Http/Controllers/StockUsageController.php - Ingredient records
app/Models/Ingredient.php - Batch records
app/Models/IngredientBatch.php - Usage records
app/Models/StockUsage.php - Inventory monitoring
resources/js/Pages/Inventory/Index.tsx - Usage history
resources/js/Pages/Usage/Index.tsx
Waste governance
- Waste reporting approval
app/Http/Controllers/WasteLogController.php - Waste records
app/Models/WasteLog.php - Waste authorization
app/Policies/WasteLogPolicy.php - Waste review
resources/js/Pages/Waste/Index.tsx
Dashboards analytics
- Role dashboards
app/Http/Controllers/DashboardController.php - Financial analytics export
app/Http/Controllers/DashboardController.php - Analytics view
resources/js/Pages/Analytics/Index.tsx - Dashboard views
resources/js/Pages/Dashboard.tsx
Web application
- Auth routes
routes/auth.php - Session authentication
app/Http/Controllers/Auth/AuthenticatedSessionController.php - Application routes
routes/web.php - Role access control
app/Http/Middleware/RoleMiddleware.php - Inertia middleware
app/Http/Middleware/HandleInertiaRequests.php - React pages layouts
resources/js/Pages
Other components
- Cafe staff
- Relational database
Connections 37
- Cafe staff → Auth routes: submits credentials
routes/auth.php - Auth routes → Session authentication: routes login
routes/auth.php - Session authentication → React pages layouts: renders login
app/Http/Controllers/Auth/AuthenticatedSessionController.php - Session authentication → Cafe staff: redirects by role
app/Http/Controllers/Auth/AuthenticatedSessionController.php - Cafe staff → Application routes: requests inventory
- Application routes → Role access control: applies role checks
- Application routes → Batch management: routes batch actions
- Application routes → Ingredient catalog: routes catalog actions
- Application routes → Stock usage: routes usage actions
- Application routes → Waste reporting approval: routes waste actions
- Application routes → Role dashboards: routes dashboards
- Batch management → FEFO expiry rules: orders FEFO batches
app/Http/Controllers/IngredientBatchController.php - Batch management → Ingredient records: reads ingredients
app/Http/Controllers/IngredientBatchController.php - Batch management → Batch records: reads writes batches
app/Http/Controllers/IngredientBatchController.php - Batch management → Inventory monitoring: renders inventory
- Ingredient catalog → Ingredient records: manages catalog
- Category management → Relational database: manages categories
- Stock usage → Ingredient records: reads ingredient
app/Http/Controllers/StockUsageController.php - Stock usage → Batch records: selects and updates batch
app/Http/Controllers/StockUsageController.php - Stock usage → Usage records: records consumption
app/Http/Controllers/StockUsageController.php - Stock usage → Usage history: renders usage
- Waste reporting approval → Batch records: updates batch stock
app/Http/Controllers/WasteLogController.php - Waste reporting approval → Waste records: records approval
app/Http/Controllers/WasteLogController.php - Waste authorization → Waste records: authorizes actions
app/Policies/WasteLogPolicy.php - Waste reporting approval → Waste review: renders waste review
- Role dashboards → Batch records: reads active batches
app/Http/Controllers/DashboardController.php - Role dashboards → Usage records: reads usage metrics
app/Http/Controllers/DashboardController.php - Role dashboards → Waste records: reads waste metrics
app/Http/Controllers/DashboardController.php - Role dashboards → Dashboard views: renders dashboard
app/Http/Controllers/DashboardController.php - Financial analytics export → Waste records: reads approved waste
app/Http/Controllers/DashboardController.php - Financial analytics export → Usage records: reads FEFO compliance
app/Http/Controllers/DashboardController.php - Financial analytics export → Analytics view: renders analytics
app/Http/Controllers/DashboardController.php - Batch records → Relational database: persists batches
- Ingredient records → Relational database: persists ingredients
- Usage records → Relational database: persists usage
- Waste records → Relational database: persists waste
- Inertia middleware → React pages layouts: shares request data