I have a Laravel aplication, with standard Authentication implemented. I would like to get the paginated list of the users in a table, but I get this error:
BadMethodCallException in Macroable.php line 81: Method paginate does not exist.
Here is the code:
$users = User::all()->paginate(25);
If I use this without calling the paginate() method, everything works well. Am I doing something wrong? I searched a lot, but I cannot find the answer.