ezavalishin/laravel-jsonapi-paginator is a Laravel package for :package_description.
It currently has 0 GitHub stars and 10 downloads on Packagist (latest version 0.1.3).
Install it with composer require ezavalishin/laravel-jsonapi-paginator.
Discover more Laravel packages by ezavalishin
or browse all Laravel packages to compare alternatives.
Last updated
This is where your description should go. Take a look at contributing.md to see a to do list.
Via Composer
$ composer require ezavalishin/laravel-jsonapi-paginator
Optionally you can publish the config file with:
$ php artisan vendor:publish --provider="ezavalishin/LaravelJsonApiPaginator\LaravelJsonApiPaginatorServiceProvider" --tag="config"
To paginate the results according to the json API spec, simply call the jsonPaginate method.
YourModel::jsonApiPaginate();
Of course you may still use all the builder methods you know and love:
YourModel::where('my_field', 'myValue')->jsonApiPaginate();
By default the maximum page size is set to 30. You can change this number in the config file or just pass the value to jsonPaginate.
$maxResults = 60;
YourModel::jsonApiPaginate($maxResults);
Supports: ?page[offset] and ?page[limit]
Supports: ?page[number] and ?page[size]
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
MIT. Please see the license file for more information.