AbstractCursorPaginator
Implements
Uses
Properties
$perPage int
The number of items to be shown per page.
$path string
The base path to assign to all URLs.
$query array
The query parameters to add to all URLs.
$fragment string|null
The URL fragment to add to all URLs.
$cursorName string
The cursor string variable used to store the page.
$parameters array
The paginator parameters for the cursor.
$options array
The paginator options.
Methods
previousPageUrl ( ) : string|null
Get the URL for the previous page.
nextPageUrl ( ) : string|null
The URL for the next page, or null.
getCursorForItem ( $item , $isNext ) : Cursor
Get a cursor instance for the given item.
Parameters
- $item ArrayAccess |stdClass
- $isNext bool
getParametersForItem ( $item ) : array
Get the cursor parameters for a given object.
Parameters
- $item ArrayAccess |stdClass
getPivotParameterForItem ( $item , $parameterName ) : string|null
Get the cursor parameter value from a pivot model if applicable.
Parameters
- $item ArrayAccess |stdClass
- $parameterName string
ensureParameterIsPrimitive ( $parameter ) : mixed
Ensure the parameter is a primitive type.
Parameters
- $parameter mixed
fragment ( $fragment ) : $this|string|null
Get / set the URL fragment to be appended to URLs.
Parameters
- $fragment string|null
appends ( $key , $value ) : $this
Add a set of query string values to the paginator.
Parameters
- $key array|string|null
- $value string|null
appendArray ( array $keys ) : $this
Add an array of query string values.
Parameters
- $keys array
withQueryString ( ) : $this
Add all current query string values to the paginator.
addQuery ( $key , $value ) : $this
Add a query string value to the paginator.
Parameters
- $key string
- $value string
buildFragment ( ) : string
Build the full fragment portion of a URL.
loadMorph ( $relation , $relations ) : $this
Load a set of relationships onto the mixed relationship collection.
Parameters
- $relation string
- $relations array
loadMorphCount ( $relation , $relations ) : $this
Load a set of relationship counts onto the mixed relationship collection.
Parameters
- $relation string
- $relations array
items ( ) : array
Get the slice of items being paginated.
through ( callable $callback ) : $this
Transform each item in the slice of items using a callback.
Parameters
- $callback callable
perPage ( ) : int
Get the number of items shown per page.
getCursorName ( ) : string
Get the query string variable used to store the cursor.
setCursorName ( $name ) : $this
Set the query string variable used to store the cursor.
Parameters
- $name string
withPath ( $path ) : $this
Set the base path to assign to all URLs.
Parameters
- $path string
setPath ( $path ) : $this
Set the base path to assign to all URLs.
Parameters
- $path string
path ( ) : string|null
Get the base path for paginator generated URLs.
resolveCurrentCursor ( $cursorName , $default ) : Cursor |null
Resolve the current cursor or return the default value.
Parameters
- $cursorName string
currentCursorResolver ( Closure $resolver ) : void
Set the current cursor resolver callback.
Parameters
- $resolver Closure
isEmpty ( ) : bool
Determine if the list of items is empty.
isNotEmpty ( ) : bool
Determine if the list of items is not empty.
count ( ) : int
Get the number of items for the current page.
setCollection ( Collection $collection ) : $this
Set the paginator's underlying collection.
Parameters
- $collection Collection
getOptions ( ) : array
Get the paginator options.
offsetExists ( $key ) : bool
Determine if the given item exists.
Parameters
- $key mixed
offsetGet ( $key ) : mixed
Get the item at the given offset.
Parameters
- $key mixed
offsetSet ( $key , $value ) : void
Set the item at the given offset.
Parameters
- $key mixed
- $value mixed
offsetUnset ( $key ) : void
Unset the item at the given key.
Parameters
- $key mixed
toHtml ( ) : string
Render the contents of the paginator to HTML.
__call ( $method , $parameters ) : mixed
Make dynamic calls into the collection.
Parameters
- $method string
- $parameters array
__toString ( ) : string
Render the contents of the paginator when casting to a string.