heseya / pagination
Heseya Pagination Middleware for Laravel
Installs: 3 821
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- laravel/framework: ^8.0|^9.0|^10.0|^11.0
README
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