dutchcodingcompany/cursor-pagination

Cursor pagination for Laravel Lighthouse GraphQL API

0.1.1 2020-06-26 09:59 UTC

This package is auto-updated.

Last update: 2024-11-26 19:53:07 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

This Laravel package brings cursor based pagination support to Laravel and Lighthouse in particular.

Installation

You can install the package via composer:

composer require dutchcodingcompany/cursor-pagination

Usage

GraphQL

Add 'DutchCodingCompany\\CursorPagination\\Directives' to config/lighthouse.php under

namespaces => [
   'directives' => ['DutchCodingCompany\\CursorPagination\\Directives']
]

Builder

Call cursorPaginate() on an Eloquent or Query Builder

User::orderBy('updated_at', 'asc')->cursorPaginate($limit);

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email m@rcoboe.rs instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.