fix(pg): enable global server-side search across all pages with debounce and per-page selector

This commit is contained in:
Ray1111-aa
2026-10-27 13:17:47 +07:00
parent 552cee267a
commit 500547116f
2 changed files with 36 additions and 94 deletions
@@ -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();