diff --git a/app/Http/Controllers/Pg/SecurityGuardController.php b/app/Http/Controllers/Pg/SecurityGuardController.php index d9e2940..e3fa12e 100644 --- a/app/Http/Controllers/Pg/SecurityGuardController.php +++ b/app/Http/Controllers/Pg/SecurityGuardController.php @@ -54,10 +54,15 @@ class SecurityGuardController extends Controller */ public function index(Request $request): View { + $perPage = (int) $request->input('per_page', 20); + if (!in_array($perPage, [20, 50, 100])) { + $perPage = 20; + } + $guards = $this->getGuardsQuery($request) ->orderBy('team') ->orderBy('name') - ->paginate(20) + ->paginate($perPage) ->withQueryString(); $gates = Gate::where('is_active', true)->orderBy('name')->get(); diff --git a/resources/views/pg/guards_index.blade.php b/resources/views/pg/guards_index.blade.php index a022328..d02c523 100644 --- a/resources/views/pg/guards_index.blade.php +++ b/resources/views/pg/guards_index.blade.php @@ -62,7 +62,7 @@ -