lartie / api-pagination
Laravel Api Pagination
dev-master
2021-04-14 09:43 UTC
Requires
- php: >=7
This package is not auto-updated.
Last update: 2024-12-21 22:08:13 UTC
README
Installation
Composer
composer require "lartie/api-pagination"
ApiPaginationTrait
Include ApiPaginationTrait
trait inside your model.
class User extends Model { use ApiPaginationTrait;
And that's it!
Usage
How To Use
User::where('is_blocked', false)->apiPagination($limit, $offset);
Result
[ 'items' => [...], 'hasNextPage' => true, //or false ]
License
The MIT License (MIT). Please see License File for more information.