I'm building custom project and for now for database connection i used illuminate/database the eloquent model. But i need samo pagination to continue my development i installed via composer illuminate/pagination and i cant configure it propertly i searched all over the internet no documentation for using with illuminate pagination or how to configure it.
I have function
User::all();
Where i fetch all my users successfully but i need to make paginate when i try to use ->paginate() method not found.
The composer is set coorectly and all my files are loaded.
Any tips how to set up the illuminate/pagination library ? Btw i developed custom framework where i have controller and models. All my models are Eloquent models.
Thanks
You can check out the forPage() method on the Collection itself. https://laravel.com/docs/5.8/collections#method-forpage
This worked for me: