Cursorable
Adds cursor-based pagination for efficient list traversal
The withCursorable
mixin adds cursor-based pagination to your models, following the Relay Connection specification pattern. This pagination approach is ideal for efficiently traversing large datasets and provides stable pagination even when items are added or removed.
Usage
API Reference
withCursorable()
Enhances a model with cursor-based pagination methods.
Configuration Options
sortKeys
: Record mapping sort key names to column sort configurationsmax
: Maximum number of records that can be requested in a single page (default: 100)limit
: Default number of records to return per page (default: 10)sortKey
: Default sort key to use when none is specified
Column Sort Configuration
Added Methods
getCursorableQuery()
Creates a query builder configured for cursor-based pagination.