https://github.com/dutchcodingcompany/cursor-pagination
Cursor pagination for Laravel
https://github.com/dutchcodingcompany/cursor-pagination
Last synced: 14 days ago
JSON representation
Cursor pagination for Laravel
- Host: GitHub
- URL: https://github.com/dutchcodingcompany/cursor-pagination
- Owner: DutchCodingCompany
- License: mit
- Created: 2020-06-26T07:32:58.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T10:08:41.000Z (about 5 years ago)
- Last Synced: 2025-02-16T10:34:41.807Z (5 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Very short description of the package
[](https://packagist.org/packages/dutchcodingcompany/cursor-pagination)
[](https://travis-ci.org/dutchcodingcompany/cursor-pagination)
[](https://scrutinizer-ci.com/g/dutchcodingcompany/cursor-pagination)
[](https://packagist.org/packages/dutchcodingcompany/cursor-pagination)This Laravel package brings cursor based pagination support to Laravel and [Lighthouse](https://github.com/nuwave/lighthouse) in particular.
## Installation
You can install the package via composer:
```bash
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
``` php
User::orderBy('updated_at', 'asc')->cursorPaginate($limit);
```### Testing
``` bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Marco Boers](https://github.com/dutchcodingcompany)
- [Dutch Coding Company](https://github.com/DutchCodingCompany)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.