Skip to content

andrepgsilva/lara-array-pagination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaraArrayPagination

Avoid waste time creating your own paginator and use this package for paginate your array in Laravel.

Installation

composer require laravel-array-pagination

How to use

use Andrepgsilva\LaraArrayPagination\Classes\ArrayPaginator;

$fruits = ['orange', 'apple', 'watermelon', 'banana'];

$paginator = new ArrayPaginator();
// That's it!
$paginatedContent = $paginator->paginate($fruits);

Custom pagination

// You can pass the number of page results. The default is 3.
// Even the URL path that you want use
$paginator->paginate($fruits, $perPage = 3, ['path' => 'http://example.com']);

About

Laravel pagination for arrays

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages