samedi 4 juin 2016

Manual Pagination in Laravel 5.1

I have an array of results (more than 25 result) fetched from the database. I am trying to implement Laravel Pagination in my application.

What I want is paginate the results fetched.

What I get is pagination of the same results.

The code that I have used so far:

$result = array_slice($fetchAllProducts, 0, 12);

$paginateResults = new Illuminate\Pagination\LengthAwarePaginator($result, count($fetchAllProducts), 12);

I do get the pagination, but when working inspecting, on page 2, on page 3, and so on.. I get the result that is visible on page 1 of the pagination on all the subsequent pages of the pagination.

Kindly help me out with this. Any help is highly appreciated.

P.S.: I am trying to learn on my own how to integrate custom pagination in Laravel 5.1



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire