fix: paginate user search results

This commit is contained in:
Miguel Nogueira 2022-03-06 12:56:41 +00:00
parent 0e85f81fe6
commit ec23c05c5f

View File

@ -66,7 +66,7 @@ class UserController extends Controller
$matchingUsers = User::query()
->where('name', 'LIKE', "%{$searchTerm}%")
->orWhere('email', 'LIKE', "%{$searchTerm}%")
->get();
->paginate(6);
if (! $matchingUsers->isEmpty()) {
$request->session()->flash('success', __('There were :usersCount user(s) matching your search.', ['usersCount' => $matchingUsers->count()]));