LengthAwarePaginator
class LengthAwarePaginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, JsonSerializable, Jsonable, LengthAwarePaginator (View source)
Methods
Get / set the URL fragment to be appended to URLs.
Add a set of query string values to the paginator.
Add a query string value to the paginator.
Determine if there are enough items to split into multiple pages.
Resolve the current request path or return the default value.
Resolve the current page or return the default value.
Set the query string variable used to store the page.
Make dynamic calls into the collection.
Render the contents of the paginator when casting to string.
Create a new paginator instance.
Get the URL for the next page.
Determine if there are more items in the data source.
Get the total number of items being paginated.
Get the last page.
Get the instance as an array.
Convert the object into something JSON serializable.
Convert the object to its JSON representation.
Details
in AbstractPaginator at line line 101
string
getUrlRange(
int $start,
int $end)
Create a range of pagination URLs.
in AbstractPaginator at line line 144
string|null
previousPageUrl()
Get the URL for the previous page.
in AbstractPaginator at line line 157
$this|string|null
fragment(
string|null $fragment = null)
Get / set the URL fragment to be appended to URLs.
in AbstractPaginator at line line 175
$this
appends(
array|string $key,
string|null $value = null)
Add a set of query string values to the paginator.
in AbstractPaginator at line line 206
$this
addQuery(
string $key,
string $value)
Add a query string value to the paginator.
in AbstractPaginator at line line 240
int
firstItem()
Get the number of the first item in the slice.
in AbstractPaginator at line line 288
bool
hasPages()
Determine if there are enough items to split into multiple pages.
in AbstractPaginator at line line 299
static
string
resolveCurrentPath(
string $default = '/')
Resolve the current request path or return the default value.
in AbstractPaginator at line line 314
static
void
currentPathResolver(
Closure $resolver)
Set the current request path resolver callback.
in AbstractPaginator at line line 326
static
int
resolveCurrentPage(
string $pageName = 'page',
int $default = 1)
Resolve the current page or return the default value.
in AbstractPaginator at line line 341
static
void
currentPageResolver(
Closure $resolver)
Set the current page resolver callback.
in AbstractPaginator at line line 352
static
void
presenter(
Closure $resolver)
Set the default Presenter resolver.
in AbstractPaginator at line line 362
string
getPageName()
Get the query string variable used to store the page.
in AbstractPaginator at line line 373
$this
setPageName(
string $name)
Set the query string variable used to store the page.
in AbstractPaginator at line line 386
$this
setPath(
string $path)
Set the base path to assign to all URLs.
in AbstractPaginator at line line 408
bool
isEmpty()
Determine if the list of items is empty or not.
in AbstractPaginator at line line 428
Collection
getCollection()
Get the paginator's underlying collection.
in AbstractPaginator at line line 439
$this
setCollection(
Collection $collection)
Set the paginator's underlying collection.
in AbstractPaginator at line line 452
bool
offsetExists(
mixed $key)
Determine if the given item exists.
in AbstractPaginator at line line 463
mixed
offsetGet(
mixed $key)
Get the item at the given offset.
in AbstractPaginator at line line 475
void
offsetSet(
mixed $key,
mixed $value)
Set the item at the given offset.
in AbstractPaginator at line line 486
void
offsetUnset(
mixed $key)
Unset the item at the given key.
in AbstractPaginator at line line 508
mixed
__call(
string $method,
array $parameters)
Make dynamic calls into the collection.
in AbstractPaginator at line line 518
string
__toString()
Render the contents of the paginator when casting to string.
at line line 41
void
__construct(
mixed $items,
int $total,
int $perPage,
int|null $currentPage = null,
array $options = array())
Create a new paginator instance.
at line line 117
string
links(
Presenter $presenter = null)
Render the paginator using the given presenter.