2026-10-12 23:47:41 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Auth\LoginController;
|
2026-10-14 01:38:48 +07:00
|
|
|
use App\Http\Controllers\HomeController;
|
2026-10-12 23:47:41 +07:00
|
|
|
use App\Http\Controllers\Hse\EmployeeController;
|
2026-10-13 15:17:41 +07:00
|
|
|
use App\Http\Controllers\Pg\DashboardController as PgDashboardController;
|
2026-10-12 23:47:41 +07:00
|
|
|
use App\Http\Controllers\Pg\GateInspectionController;
|
|
|
|
|
use App\Http\Controllers\Pg\SecurityGuardController;
|
2026-10-13 14:54:50 +07:00
|
|
|
use App\Http\Controllers\Pg\VerificationLogController;
|
2026-10-12 23:47:41 +07:00
|
|
|
use App\Http\Controllers\ProfileController;
|
|
|
|
|
use App\Http\Controllers\Public\VehicleActivityFormController;
|
|
|
|
|
use App\Http\Controllers\Qma\ActivityLogController;
|
|
|
|
|
use App\Http\Controllers\Qma\VehicleController;
|
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
2026-10-14 01:38:48 +07:00
|
|
|
// Halaman Utama (Homepage Sistem RKM Publik & Ringkasan Sistem)
|
|
|
|
|
Route::get('/', [HomeController::class, 'index'])->name('home');
|
2026-10-12 23:47:41 +07:00
|
|
|
|
|
|
|
|
// Autentikasi Pengguna (Login & Logout)
|
|
|
|
|
Route::middleware('guest')->group(function () {
|
|
|
|
|
Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login');
|
|
|
|
|
Route::post('/login', [LoginController::class, 'login'])->name('login.post');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Route::post('/logout', [LoginController::class, 'logout'])->name('logout')->middleware('auth');
|
|
|
|
|
|
2026-10-14 01:38:48 +07:00
|
|
|
// 1. Modul Publik: Pencatatan Aktivitas Kendaraan Ringan (Via Scan QR Code Mobil Unit di Lapangan)
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::prefix('gate-activity')->name('vehicle.activity.')->group(function () {
|
|
|
|
|
Route::get('/{code}', [VehicleActivityFormController::class, 'show'])->name('form');
|
2026-10-14 01:38:48 +07:00
|
|
|
Route::post('/{code}/check-nik', [VehicleActivityFormController::class, 'checkNik'])->name('check.nik');
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::post('/{code}', [VehicleActivityFormController::class, 'store'])->name('store');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Group Terproteksi Autentikasi Sistem
|
|
|
|
|
Route::middleware('auth')->group(function () {
|
|
|
|
|
|
|
|
|
|
// 2. Modul HSE: Admin HSE (Mima - 1185) - Kelola Karyawan & SIMPER
|
|
|
|
|
Route::prefix('hse')->name('hse.')->middleware('role:hse_admin')->group(function () {
|
|
|
|
|
Route::get('/dashboard', [EmployeeController::class, 'dashboard'])->name('dashboard');
|
|
|
|
|
Route::get('/employees', [EmployeeController::class, 'index'])->name('employees.index');
|
|
|
|
|
Route::post('/employees', [EmployeeController::class, 'store'])->name('employees.store');
|
|
|
|
|
Route::post('/employees/{id}', [EmployeeController::class, 'update'])->name('employees.update');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 3. Modul QMA: Admin QMA (Pinto Yuliandra - 1171) - Dashboard, Data Kendaraan & Log Aktivitas
|
|
|
|
|
Route::prefix('qma')->name('qma.')->middleware('role:qma_admin')->group(function () {
|
|
|
|
|
Route::get('/dashboard', [VehicleController::class, 'dashboard'])->name('dashboard');
|
|
|
|
|
|
|
|
|
|
// Halaman Data Kendaraan Terpisah: Light Vehicle (LV) dan Unit Support
|
|
|
|
|
Route::get('/vehicles', [VehicleController::class, 'index'])->name('vehicles.index');
|
|
|
|
|
Route::get('/vehicles/light-vehicle', [VehicleController::class, 'indexLv'])->name('vehicles.lv');
|
|
|
|
|
Route::get('/vehicles/unit-support', [VehicleController::class, 'indexSupport'])->name('vehicles.support');
|
|
|
|
|
|
|
|
|
|
Route::post('/vehicles', [VehicleController::class, 'store'])->name('vehicles.store');
|
|
|
|
|
Route::post('/vehicles/{id}', [VehicleController::class, 'update'])->name('vehicles.update');
|
|
|
|
|
Route::delete('/vehicles/{id}', [VehicleController::class, 'destroy'])->name('vehicles.destroy');
|
|
|
|
|
Route::get('/activity-log', [ActivityLogController::class, 'index'])->name('activity.log');
|
2026-10-13 10:48:46 +07:00
|
|
|
Route::get('/activity-summary', [ActivityLogController::class, 'summary'])->name('activity.summary');
|
2026-10-12 23:47:41 +07:00
|
|
|
});
|
|
|
|
|
|
2026-10-13 14:54:50 +07:00
|
|
|
// 4. Modul Private Guard (PG): Admin PG & Pos Gerbang Satpam
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::prefix('pg')->name('pg.')->group(function () {
|
2026-10-13 15:17:41 +07:00
|
|
|
// Modul Admin PG (Dashboard, Data Satpam & Log Verifikasi Gerbang)
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::middleware('role:pg_admin')->group(function () {
|
2026-10-13 15:17:41 +07:00
|
|
|
Route::get('/dashboard', [PgDashboardController::class, 'index'])->name('dashboard');
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::get('/guards', [SecurityGuardController::class, 'index'])->name('guards.index');
|
|
|
|
|
Route::post('/guards', [SecurityGuardController::class, 'store'])->name('guards.store');
|
2026-10-13 13:46:35 +07:00
|
|
|
Route::post('/guards/{id}', [SecurityGuardController::class, 'update'])->name('guards.update');
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::post('/guards/{id}/toggle', [SecurityGuardController::class, 'toggleStatus'])->name('guards.toggle');
|
2026-10-14 01:38:48 +07:00
|
|
|
Route::delete('/guards/{id}', [SecurityGuardController::class, 'destroy'])->name('guards.destroy');
|
2026-10-13 14:54:50 +07:00
|
|
|
Route::get('/verification-logs', [VerificationLogController::class, 'index'])->name('logs.index');
|
2026-10-12 23:47:41 +07:00
|
|
|
});
|
|
|
|
|
|
2026-10-13 14:54:50 +07:00
|
|
|
// Verifikasi Pos Gerbang (Khusus Petugas Satpam Pos Gerbang)
|
|
|
|
|
Route::middleware('role:gate_officer')->group(function () {
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::get('/gate-inspection', [GateInspectionController::class, 'index'])->name('gate.inspection');
|
2026-10-14 01:38:48 +07:00
|
|
|
Route::get('/gate-inspection/live-queue', [GateInspectionController::class, 'liveQueue'])->name('gate.live_queue');
|
2026-10-12 23:47:41 +07:00
|
|
|
Route::post('/gate-inspection/{id}/approve', [GateInspectionController::class, 'approve'])->name('gate.approve');
|
|
|
|
|
Route::post('/gate-inspection/{id}/reject', [GateInspectionController::class, 'reject'])->name('gate.reject');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 5. Modul Profil Saya (Seluruh Pengguna Terautentikasi)
|
|
|
|
|
Route::get('/profile', [ProfileController::class, 'index'])->name('profile.index');
|
|
|
|
|
Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
|
|
|
|
});
|