dutchcodingcompany / cursor-pagination
Cursor pagination for Laravel Lighthouse GraphQL API
0.1.1
2020-06-26 09:59 UTC
Requires
- php: >=7.2
- illuminate/database: 6.*|7.*
- illuminate/support: 6.*|7.*
- nuwave/lighthouse: ^4.8
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-10-26 19:43:20 UTC
README
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.