{"repo":"spatie/laravel-json-api-paginate","free":true,"listed":false,"github":"https://github.com/spatie/laravel-json-api-paginate","clone":"git clone https://github.com/spatie/laravel-json-api-paginate.git","description":"A paginator that plays nice with the JSON API spec","language":"PHP","stars":640,"topics":["laravel","api","json","paginate","spec","php"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"A paginator that plays nice with the JSON API spec In a vanilla Laravel application the query builder paginators will listen to page request parameter. This works great, but it does not follow the example solution of the json:api spec. That example expects the query builder paginator to listen to the page[number] and page[size] request parameters. This package adds a jsonPaginate method to the Eloquent query builder that listens to those parameters and adds the pagination links the spec requires. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: In Laravel 5.5 and above the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file: Optionally you can publish the config file with: This is the content of the file that will be published in config/json-api-paginate.php Usage To paginate the results according to the json API spec, simply call the jsonPaginate method. Of course you may still use all the builder methods you know and love: You can also paginate results for relations: Fast pagination With limit / offset pagination, the","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-json-api-paginate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}