Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dutchcodingcompany/cursor-pagination
Cursor pagination for Laravel
https://github.com/dutchcodingcompany/cursor-pagination
Last synced: about 1 month 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T10:08:41.000Z (over 4 years ago)
- Last Synced: 2024-06-01T08:05:03.322Z (7 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
[![Latest Version on Packagist](https://img.shields.io/packagist/v/dutchcodingcompany/cursor-pagination.svg?style=flat-square)](https://packagist.org/packages/dutchcodingcompany/cursor-pagination)
[![Build Status](https://img.shields.io/travis/dutchcodingcompany/cursor-pagination/master.svg?style=flat-square)](https://travis-ci.org/dutchcodingcompany/cursor-pagination)
[![Quality Score](https://img.shields.io/scrutinizer/g/dutchcodingcompany/cursor-pagination.svg?style=flat-square)](https://scrutinizer-ci.com/g/dutchcodingcompany/cursor-pagination)
[![Total Downloads](https://img.shields.io/packagist/dt/dutchcodingcompany/cursor-pagination.svg?style=flat-square)](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.