lartie / api-pagination by lartie

Laravel Api Pagination
21
6
2
Package Data
Maintainer Username: lartie
Maintainer Contact: log.wil.log@gmail.com (Artemy Beliankin)
Package Create Date: 2017-02-03
Package Last Update: 2021-04-14
Language: PHP
License: MIT
Last Refreshed: 2024-12-01 15:03:09
Package Statistics
Total Downloads: 21
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 6
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laravel Api Pagination

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.