Last active
August 29, 2015 14:19
-
-
Save rdgutierrez/418173f9f3300077471f to your computer and use it in GitHub Desktop.
Error "FatalErrorException: Error: Call to undefined method Illuminate\Database\Eloquent\Collection::paginate()"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Según lo que dice este post https://github.com/laravel/framework/issues/213 | |
| Si estas obteniendo el siguiente error | |
| FatalErrorException: Error: Call to undefined method | |
| Illuminate\Database\Eloquent\Collection::paginate() | |
| El error se da por querer usar ::all()->paginate(15); la idea es usar por ejemplo si estamos leyendo la tabla users: | |
| User::paginate(15); | |
| Lo que si es aceptable es meter condiciones a la busqueda, como esto: | |
| Post::where('user_id', '=', $id )->paginate(5); | |
| Esto también es aceptable | |
| Items::orderBy('day', 'ASC')->orderBy('level', 'ASC')->paginate(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment