mercredi 7 décembre 2016

How to create a paginator?

I've checked out the rather thin docs, but still unsure how to do this.

I have a collection. I wish to manually create a paginator.

I think I have to do something like, in my controller:

new \Illuminate\Pagination\LengthAwarePaginator()

But, what params do I need and do I need to slice the collection? Also how do I then display the 'links' in my view?

Could someone post a simple example how to create a paginator?

Please note, I don't want to paginate eloquent, eg. User::paginate(10);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire