class LengthAwarePaginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, JsonSerializable, LengthAwarePaginator (View source)
ForwardsCalls |
protected Collection | $items | All of the items being paginated. | from AbstractPaginator |
protected int | $perPage | The number of items to be shown per page. | from AbstractPaginator |
protected int | $currentPage | The current page being "viewed". | from AbstractPaginator |
protected string | $path | The base path to assign to all URLs. | from AbstractPaginator |
protected array | $query | The query parameters to add to all URLs. | from AbstractPaginator |
protected string|null | $fragment | The URL fragment to add to all URLs. | from AbstractPaginator |
protected string | $pageName | The query string variable used to store the page. | from AbstractPaginator |
int | $onEachSide | The number of links to display on each side of current page link. | from AbstractPaginator |
protected array | $options | The paginator options. | from AbstractPaginator |
static protected Closure | $currentPathResolver | The current path resolver callback. | from AbstractPaginator |
static protected Closure | $currentPageResolver | The current page resolver callback. | from AbstractPaginator |
static protected Closure | $queryStringResolver | The query string resolver callback. | from AbstractPaginator |
static protected Closure | $viewFactoryResolver | The view factory resolver callback. | from AbstractPaginator |
static string | $defaultView | The default pagination view. | from AbstractPaginator |
static string | $defaultSimpleView | The default "simple" pagination view. | from AbstractPaginator |
protected int | $total | The total number of items before slicing. | |
protected int | $lastPage | The last available page. |
mixed | forwardCallTo(mixed $object, string $method, array $parameters) Forward a method call to the given object. | from ForwardsCalls |
static void | throwBadMethodCallException(string $method) Throw a bad method call exception for the given method. | from ForwardsCalls |
bool | isValidPageNumber(int $page) Determine if the given value is a valid page number. | from AbstractPaginator |
string|null | previousPageUrl() Get the URL for the previous page. | from AbstractPaginator |
array | getUrlRange(int $start, int $end) Create a range of pagination URLs. | from AbstractPaginator |
string | url(int $page) Get the URL for a given page number. | from AbstractPaginator |
$this|string|null | fragment(string|null $fragment = null) Get / set the URL fragment to be appended to URLs. | from AbstractPaginator |
$this | appends(array|string|null $key, string|null $value = null) Add a set of query string values to the paginator. | from AbstractPaginator |
$this | appendArray(array $keys) Add an array of query string values. | from AbstractPaginator |
$this | withQueryString() Add all current query string values to the paginator. | from AbstractPaginator |
$this | addQuery(string $key, string $value) Add a query string value to the paginator. | from AbstractPaginator |
string | buildFragment() Build the full fragment portion of a URL. | from AbstractPaginator |
$this | loadMorph(string $relation, array $relations) Load a set of relationships onto the mixed relationship collection. | from AbstractPaginator |
$this | loadMorphCount(string $relation, array $relations) Load a set of relationship counts onto the mixed relationship collection. | from AbstractPaginator |
array | items() Get the slice of items being paginated. | from AbstractPaginator |
int | firstItem() Get the number of the first item in the slice. | from AbstractPaginator |
int | lastItem() Get the number of the last item in the slice. | from AbstractPaginator |
$this | through(callable $callback) Transform each item in the slice of items using a callback. | from AbstractPaginator |
int | perPage() Get the number of items shown per page. | from AbstractPaginator |
bool | hasPages() Determine if there are enough items to split into multiple pages. | from AbstractPaginator |
bool | onFirstPage() Determine if the paginator is on the first page. | from AbstractPaginator |
int | currentPage() Get the current page. | from AbstractPaginator |
string | getPageName() Get the query string variable used to store the page. | from AbstractPaginator |
$this | setPageName(string $name) Set the query string variable used to store the page. | from AbstractPaginator |
$this | withPath(string $path) Set the base path to assign to all URLs. | from AbstractPaginator |
$this | setPath(string $path) Set the base path to assign to all URLs. | from AbstractPaginator |
$this | onEachSide(int $count) Set the number of links to display on each side of current page link. | from AbstractPaginator |
string|null | path() Get the base path for paginator generated URLs. | from AbstractPaginator |
static string | resolveCurrentPath(string $default = '/') Resolve the current request path or return the default value. | from AbstractPaginator |
static void | currentPathResolver(Closure $resolver) Set the current request path resolver callback. | from AbstractPaginator |
static int | resolveCurrentPage(string $pageName = 'page', int $default = 1) Resolve the current page or return the default value. | from AbstractPaginator |
static void | currentPageResolver(Closure $resolver) Set the current page resolver callback. | from AbstractPaginator |
static void | queryStringResolver(Closure $resolver) Set with query string resolver callback. | from AbstractPaginator |
static Factory | viewFactory() Get an instance of the view factory from the resolver. | from AbstractPaginator |
static void | viewFactoryResolver(Closure $resolver) Set the view factory resolver callback. | from AbstractPaginator |
static void | defaultView(string $view) Set the default pagination view. | from AbstractPaginator |
static void | defaultSimpleView(string $view) Set the default "simple" pagination view. | from AbstractPaginator |
static void | useTailwind() Indicate that Tailwind styling should be used for generated links. | from AbstractPaginator |
static void | useBootstrap() Indicate that Bootstrap 4 styling should be used for generated links. | from AbstractPaginator |
static void | useBootstrapThree() Indicate that Bootstrap 3 styling should be used for generated links. | from AbstractPaginator |
ArrayIterator | getIterator() Get an iterator for the items. | from AbstractPaginator |
bool | isEmpty() Determine if the list of items is empty. | from AbstractPaginator |
bool | isNotEmpty() Determine if the list of items is not empty. | from AbstractPaginator |
int | count() Get the number of items for the current page. | from AbstractPaginator |
Collection | getCollection() Get the paginator's underlying collection. | from AbstractPaginator |
$this | setCollection(Collection $collection) Set the paginator's underlying collection. | from AbstractPaginator |
array | getOptions() Get the paginator options. | from AbstractPaginator |
bool | offsetExists(mixed $key) Determine if the given item exists. | from AbstractPaginator |
mixed | offsetGet(mixed $key) Get the item at the given offset. | from AbstractPaginator |
void | offsetSet(mixed $key, mixed $value) Set the item at the given offset. | from AbstractPaginator |
void | offsetUnset(mixed $key) Unset the item at the given key. | from AbstractPaginator |
string | toHtml() Render the contents of the paginator to HTML. | from AbstractPaginator |
mixed | __call(string $method, array $parameters) Make dynamic calls into the collection. | from AbstractPaginator |
string | __toString() Render the contents of the paginator when casting to string. | from AbstractPaginator |
void | __construct(mixed $items, int $total, int $perPage, int|null $currentPage = null, array $options = []) Create a new paginator instance. | |
int | setCurrentPage(int $currentPage, string $pageName) Get the current page for the request. | |
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. | |
Collection | linkCollection() Get the paginator links as a collection (for JSON responses). | |
array | elements() Get the array of elements to pass to the view. | |
int | total() Get the total number of items being paginated. | |
bool | hasMorePages() Determine if there are more items in the data source. | |
string|null | nextPageUrl() Get the URL for the next page. | |
int | lastPage() Get the last page. | |
array | 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.
Throw a bad method call exception for the given method.
Determine if the given value is a valid page number.
Get the URL for the previous page.
Create a range of pagination URLs.
Get the URL for a given page number.
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.
Get the number of the first item in the slice.
Get the number of the last item in the slice.
Transform each item in the slice of items using a callback.
Get the number of items shown per page.
Determine if there are enough items to split into multiple pages.
Determine if the paginator is on the first page.
Get the current page.
Get the query string variable used to store the page.
Set the query string variable used to store the page.
Set the base path to assign to all URLs.
Set the base path to assign to all URLs.
Set the number of links to display on each side of current page link.
Get the base path for paginator generated URLs.
Resolve the current request path or return the default value.
Set the current request path resolver callback.
Resolve the current page or return the default value.
Set the current page resolver callback.
Set with query string resolver callback.
Get an instance of the view factory from the resolver.
Set the view factory resolver callback.
Set the default pagination view.
Set the default "simple" pagination view.
Indicate that Tailwind styling should be used for generated links.
Indicate that Bootstrap 4 styling should be used for generated links.
Indicate that Bootstrap 3 styling should be used for generated links.
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 string.
Create a new paginator instance.
Get the current page for the request.
Render the paginator using the given view.
Render the paginator using the given view.
Get the paginator links as a collection (for JSON responses).
Get the array of elements to pass to the view.
Get the total number of items being paginated.
Determine if there are more items in the data source.
Get the URL for the next page.
Get 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/8.x/Illuminate/Pagination/LengthAwarePaginator.html