I would like to get the total number of users on the page where all users are listed. This page should be paginated.
So far this is what I came up with:
controller
$users = User::paginate(10);
return View::make('index', compact('users'));
View:
{{{ count($users) }}}
But this only gives me the number of users for the current page. I would like to calculate a complete set of results, if possible, without querying another database time.
source
share