2017 © Pedro Peláez
 

library laravel-api-pagination

API Pagination For Laravel & Lumen

image

elemenx/laravel-api-pagination

API Pagination For Laravel & Lumen

  • Monday, March 12, 2018
  • by branchzero
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1,049 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 95 % Grown

The README.md

Note

Inspired By Illuminate Pagination, This Package Used For Api Pagination (by limit/offset), (*1)

Changelog

  • 0.1.6 Fix Wrong Default Limit Value
  • 0.1.5 Fix Error When No Data
  • 0.1.4 Fix Typo.
  • 0.1.3 Fix Scope.
  • 0.1.2 Bump Version.
  • 0.1.1 Fix Unresolved Dependency.
  • 0.1.0 Init Version.

How to install (steps)

1. Install using Composer

composer require "elemenx/laravel-api-pagination"

2. Required changes in bootstrap/app.php (If using Lumen)

On bootstrap/app.php add:, (*2)

$app->register(ElemenX\ApiPagination\PaginationServiceProvider::class);

3.Add Trait in Your Models

use ElemenX\ApiPagination\Paginatable;

class User {
    use Paginatable;
}

Example

This is an example for how to use this package., (*3)

$users = User::apiPaginate(100); // 100 is your defalut limit number

when you visit with, (*4)

http://api.dev/user?limit=100&offset=0

It will return Structure As follows., (*5)

[
    'data' => [
        [
            'id' => 1,
            'name' => 'test'
        ]
    ],
    'meta' => [
        'limit' => 100,
        'offset' => 0,
        'total' => 1
    ]
]

The Versions

12/03 2018

dev-master

9999999-dev

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

12/03 2018

0.1.6

0.1.6.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

01/03 2018

0.1.5

0.1.5.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

22/02 2018

0.1.4

0.1.4.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

22/02 2018

0.1.3

0.1.3.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

21/02 2018

0.1.2

0.1.2.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

21/02 2018

0.1.1

0.1.1.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx

21/02 2018

0.1.0

0.1.0.0

API Pagination For Laravel & Lumen

  Sources   Download

MIT

The Requires

  • php >=7.0

 

laravel api lumen pagination elemenx