From 001f2095c10006ace95d9cc515cd55e3cd369345 Mon Sep 17 00:00:00 2001 From: Sveemaaa Date: Tue, 7 Apr 2026 15:36:47 +0700 Subject: [PATCH] controller laporan --- .../Http/Controllers/LaporanController.php | 28 +++++++++++++++++++ project/app/Models/Laporan.php | 11 ++++++++ project/routes/web.php | 5 ++++ 3 files changed, 44 insertions(+) create mode 100644 project/app/Http/Controllers/LaporanController.php create mode 100644 project/app/Models/Laporan.php diff --git a/project/app/Http/Controllers/LaporanController.php b/project/app/Http/Controllers/LaporanController.php new file mode 100644 index 0000000..97fb66a --- /dev/null +++ b/project/app/Http/Controllers/LaporanController.php @@ -0,0 +1,28 @@ +has('status') && $request->status != '') { + $query->where('hasil', $request->status); + } + + // Filter berdasarkan Bulan/Tahun (Optional) + if ($request->has('bulan') && $request->bulan != '') { + $query->whereMonth('tanggal', $request->bulan); + } + + $laporan = $query->latest()->get(); + + return view('laporan.index', compact('laporan')); + } +} diff --git a/project/app/Models/Laporan.php b/project/app/Models/Laporan.php new file mode 100644 index 0000000..2bae902 --- /dev/null +++ b/project/app/Models/Laporan.php @@ -0,0 +1,11 @@ +group(function () { +Route::get('/laporan', [LaporanController::class, 'index'])->name('laporan'); +}); +