From b1fd99644b6d4ff1fd7e4934d961855e25398867 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 15 Feb 2021 02:46:58 -0700 Subject: [PATCH] Update AdminController, show open reports by default --- app/Http/Controllers/AdminController.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 2b3f19916..aa434e8d8 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -66,17 +66,14 @@ class AdminController extends Controller public function reports(Request $request) { - $this->validate($request, [ - 'filter' => 'nullable|string|in:all,open,closed' - ]); - $filter = $request->input('filter'); + $filter = $request->input('filter') == 'closed' ? 'closed' : 'open'; $reports = Report::orderBy('created_at','desc') ->when($filter, function($q, $filter) { return $filter == 'open' ? $q->whereNull('admin_seen') : $q->whereNotNull('admin_seen'); }) - ->paginate(4); + ->paginate(6); return view('admin.reports.home', compact('reports')); }