lartie/api-pagination

Laravel Api Pagination

dev-master 2021-04-14 09:43 UTC

This package is not auto-updated.

Last update: 2021-05-15 04:02:34 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.