heseya/pagination

Heseya Pagination Middleware for Laravel
4,628
Install
composer require heseya/pagination
Latest Version:1.0.4
PHP:^8.0
License:MIT
Last Updated:Mar 18, 2024
Links: GitHub  ·  Packagist
Maintainer: bvlinsky

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/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
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