heseya/pagination
Heseya Pagination Middleware
Middleware that automatically sets pagination for all endpoints.
How it's work?
You add middleware in App\Http\Kernel
protected $middleware = [
...
Heseya\Pagination\Http\Middleware\Pagination::class,
];
or to specific route in router
Route::get(...)->middleware(Pagination::class);
Now when you send parameter limit
/products?limit=50
you can use pagination.per_page config key to set pagination limit
public function index()
{
return Product::paginate(Config::get('pagination.per_page'));
}
Installation
composer require heseya/laravel-pagination
php artisan vendor:publish --tag=pagination
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
637,827,751
9,703
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
413,412,504
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
391,429,217
4,660