LaravelPackages.net
Acme Inc.
Toggle sidebar
ezavalishin/laravel-jsonapi-paginator

:package_description

10
0
0.1.3
About ezavalishin/laravel-jsonapi-paginator

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

laravel-jsonapi-paginator

Latest Version on Packagist Total Downloads StyleCI Codecov Travis (.com)

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

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"

Usage

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);

Offset based pagination

Supports: ?page[offset] and ?page[limit]

Page based pagination

Supports: ?page[number] and ?page[size]

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Star History Chart