lartie/api-pagination

Laravel Api Pagination

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/lartie/api-pagination

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

This package is not auto-updated.

Last update: 2025-10-12 02:26:26 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.