class CursorPaginator extends AbstractCursorPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, JsonSerializable, CursorPaginator (View source)
| ForwardsCalls | |
| Tappable |
| protected Collection | $items | All of the items being paginated. | from AbstractCursorPaginator |
| protected int | $perPage | The number of items to be shown per page. | from AbstractCursorPaginator |
| protected string | $path | The base path to assign to all URLs. | from AbstractCursorPaginator |
| protected array | $query | The query parameters to add to all URLs. | from AbstractCursorPaginator |
| protected string|null | $fragment | The URL fragment to add to all URLs. | from AbstractCursorPaginator |
| protected string | $cursorName | The cursor string variable used to store the page. | from AbstractCursorPaginator |
| protected Cursor|null | $cursor | The current cursor. | from AbstractCursorPaginator |
| protected array | $parameters | The paginator parameters for the cursor. | from AbstractCursorPaginator |
| protected array | $options | The paginator options. | from AbstractCursorPaginator |
| static protected Closure | $currentCursorResolver | The current cursor resolver callback. | from AbstractCursorPaginator |
| protected | $hasMore | Indicates whether there are more items in the data source. |
| mixed | forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object. | from ForwardsCalls |
| mixed | forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself. | from ForwardsCalls |
| static void | throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method. | from ForwardsCalls |
| tap($callback = null)
Call the given Closure with this instance then return the instance. | from Tappable | |
| string | url(Cursor|null $cursor)
Get the URL for a given cursor. | from AbstractCursorPaginator |
| string|null | previousPageUrl()
Get the URL for the previous page. | from AbstractCursorPaginator |
| string|null | nextPageUrl()
The URL for the next page, or null. | from AbstractCursorPaginator |
| Cursor|null | previousCursor()
Get the "cursor" that points to the previous set of items. | from AbstractCursorPaginator |
| Cursor|null | nextCursor()
Get the "cursor" that points to the next set of items. | from AbstractCursorPaginator |
| Cursor | getCursorForItem(ArrayAccess|stdClass $item, bool $isNext = true)
Get a cursor instance for the given item. | from AbstractCursorPaginator |
| array | getParametersForItem(ArrayAccess|stdClass $item)
Get the cursor parameters for a given object. | from AbstractCursorPaginator |
| string|null | getPivotParameterForItem(ArrayAccess|stdClass $item, string $parameterName)
Get the cursor parameter value from a pivot model if applicable. | from AbstractCursorPaginator |
| mixed | ensureParameterIsPrimitive(mixed $parameter)
Ensure the parameter is a primitive type. | from AbstractCursorPaginator |
| $this|string|null | fragment(string|null $fragment = null)
Get / set the URL fragment to be appended to URLs. | from AbstractCursorPaginator |
| $this | appends(array|string|null $key, string|null $value = null)
Add a set of query string values to the paginator. | from AbstractCursorPaginator |
| $this | appendArray(array $keys)
Add an array of query string values. | from AbstractCursorPaginator |
| $this | withQueryString()
Add all current query string values to the paginator. | from AbstractCursorPaginator |
| $this | addQuery(string $key, string $value)
Add a query string value to the paginator. | from AbstractCursorPaginator |
| string | buildFragment()
Build the full fragment portion of a URL. | from AbstractCursorPaginator |
| $this | loadMorph(string $relation, array $relations)
Load a set of relationships onto the mixed relationship collection. | from AbstractCursorPaginator |
| $this | loadMorphCount(string $relation, array $relations)
Load a set of relationship counts onto the mixed relationship collection. | from AbstractCursorPaginator |
| array | items()
Get the slice of items being paginated. | from AbstractCursorPaginator |
| $this | through(callable $callback)
Transform each item in the slice of items using a callback. | from AbstractCursorPaginator |
| int | perPage()
Get the number of items shown per page. | from AbstractCursorPaginator |
| Cursor|null | cursor()
Get the current cursor being paginated. | from AbstractCursorPaginator |
| string | getCursorName()
Get the query string variable used to store the cursor. | from AbstractCursorPaginator |
| $this | setCursorName(string $name)
Set the query string variable used to store the cursor. | from AbstractCursorPaginator |
| $this | withPath(string $path)
Set the base path to assign to all URLs. | from AbstractCursorPaginator |
| $this | setPath(string $path)
Set the base path to assign to all URLs. | from AbstractCursorPaginator |
| string|null | path()
Get the base path for paginator generated URLs. | from AbstractCursorPaginator |
| static Cursor|null | resolveCurrentCursor(string $cursorName = 'cursor', $default = null)
Resolve the current cursor or return the default value. | from AbstractCursorPaginator |
| static void | currentCursorResolver(Closure $resolver)
Set the current cursor resolver callback. | from AbstractCursorPaginator |
| static Factory | viewFactory()
Get an instance of the view factory from the resolver. | from AbstractCursorPaginator |
| Traversable | getIterator()
Get an iterator for the items. | from AbstractCursorPaginator |
| bool | isEmpty()
Determine if the list of items is empty. | from AbstractCursorPaginator |
| bool | isNotEmpty()
Determine if the list of items is not empty. | from AbstractCursorPaginator |
| int | count()
Get the number of items for the current page. | from AbstractCursorPaginator |
| Collection | getCollection()
Get the paginator's underlying collection. | from AbstractCursorPaginator |
| $this | setCollection(Collection $collection)
Set the paginator's underlying collection. | from AbstractCursorPaginator |
| array | getOptions()
Get the paginator options. | from AbstractCursorPaginator |
| bool | offsetExists(mixed $key)
Determine if the given item exists. | from AbstractCursorPaginator |
| mixed | offsetGet(mixed $key)
Get the item at the given offset. | from AbstractCursorPaginator |
| void | offsetSet(mixed $key, mixed $value)
Set the item at the given offset. | from AbstractCursorPaginator |
| void | offsetUnset(mixed $key)
Unset the item at the given key. | from AbstractCursorPaginator |
| string | toHtml()
Render the contents of the paginator to HTML. | from AbstractCursorPaginator |
| mixed | __call(string $method, array $parameters)
Make dynamic calls into the collection. | from AbstractCursorPaginator |
| string | __toString()
Render the contents of the paginator when casting to a string. | from AbstractCursorPaginator |
| void | __construct(mixed $items, int $perPage, Cursor|null $cursor = null, array $options = [])
Create a new paginator instance. | |
| void | setItems(mixed $items)
Set the items for the paginator. | |
| Htmlable | links(string|null $view = null, array $data = [])
Render the paginator using the given view. | |
| string | render(string|null $view = null, array $data = [])
Render the paginator using the given view. | |
| bool | hasMorePages()
Determine if there are more items in the data source. | |
| bool | hasPages()
Determine if there are enough items to split into multiple pages. | |
| bool | onFirstPage()
Determine if the paginator is on the first page. | |
| bool | onLastPage()
Determine if the paginator is on the last page. | |
| toArray()
Get the instance as an array. | ||
| array | jsonSerialize()
Convert the object into something JSON serializable. | |
| string | toJson(int $options = 0)
Convert the object to its JSON representation. |
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Call the given Closure with this instance then return the instance.
Get the URL for a given cursor.
Get the URL for the previous page.
The URL for the next page, or null.
Get the "cursor" that points to the previous set of items.
Get the "cursor" that points to the next set of items.
Get a cursor instance for the given item.
Get the cursor parameters for a given object.
Get the cursor parameter value from a pivot model if applicable.
Ensure the parameter is a primitive type.
This can resolve issues that arise the developer uses a value object for an attribute.
Get / set the URL fragment to be appended to URLs.
Add a set of query string values to the paginator.
Add an array of query string values.
Add all current query string values to the paginator.
Add a query string value to the paginator.
Build the full fragment portion of a URL.
Load a set of relationships onto the mixed relationship collection.
Load a set of relationship counts onto the mixed relationship collection.
Get the slice of items being paginated.
Transform each item in the slice of items using a callback.
Get the number of items shown per page.
Get the current cursor being paginated.
Get the query string variable used to store the cursor.
Set the query string variable used to store the cursor.
Set the base path to assign to all URLs.
Set the base path to assign to all URLs.
Get the base path for paginator generated URLs.
Resolve the current cursor or return the default value.
Set the current cursor resolver callback.
Get an instance of the view factory from the resolver.
Get an iterator for the items.
Determine if the list of items is empty.
Determine if the list of items is not empty.
Get the number of items for the current page.
Get the paginator's underlying collection.
Set the paginator's underlying collection.
Get the paginator options.
Determine if the given item exists.
Get the item at the given offset.
Set the item at the given offset.
Unset the item at the given key.
Render the contents of the paginator to HTML.
Make dynamic calls into the collection.
Render the contents of the paginator when casting to a string.
Create a new paginator instance.
Set the items for the paginator.
Render the paginator using the given view.
Render the paginator using the given view.
Determine if there are more items in the data source.
Determine if there are enough items to split into multiple pages.
Determine if the paginator is on the first page.
Determine if the paginator is on the last page.
Get the instance as an array.
Convert the object into something JSON serializable.
Convert the object to its JSON representation.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Pagination/CursorPaginator.html