CursorPaginator
class CursorPaginator
Methods
__construct(Collection $items, int $perPage = 10, string|null $cursor = null)
Create a paginator for the supplied items.
array
paginate(string $key = 'items')
Return the current page and its continuation cursor.
int
getStartOffsetFromCursor()
Decode the starting offset from the cursor.
string
createCursor(int $offset)
Encode a continuation offset.
Details
at line 17
__construct(Collection $items, int $perPage = 10, string|null $cursor = null)
Create a paginator for the supplied items.
at line 31
array
paginate(string $key = 'items')
Return the current page and its continuation cursor.
at line 51
protected int
getStartOffsetFromCursor()
Decode the starting offset from the cursor.
at line 75
protected string
createCursor(int $offset)
Encode a continuation offset.