W3cubDocs

/Laravel 8

Paginator

interface Paginator (View source)

Methods

string url(int $page)

Get the URL for a given page.

$this appends(array|string $key, string|null $value = null)

Add a set of query string values to the paginator.

$this|string fragment(string|null $fragment = null)

Get / set the URL fragment to be appended to URLs.

string|null nextPageUrl()

The URL for the next page, or null.

string|null previousPageUrl()

Get the URL for the previous page, or null.

array items()

Get all of the items being paginated.

int firstItem()

Get the "index" of the first item being paginated.

int lastItem()

Get the "index" of the last item being paginated.

int perPage()

Determine how many items are being shown per page.

int currentPage()

Determine the current page being paginated.

bool hasPages()

Determine if there are enough items to split into multiple pages.

bool hasMorePages()

Determine if there are more items in the data store.

string|null path()

Get the base path for paginator generated URLs.

bool isEmpty()

Determine if the list of items is empty or not.

bool isNotEmpty()

Determine if the list of items is not empty.

string render(string|null $view = null, array $data = [])

Render the paginator using a given view.

Details

string url(int $page)

Get the URL for a given page.

Parameters

int $page

Return Value

string

$this appends(array|string $key, string|null $value = null)

Add a set of query string values to the paginator.

Parameters

array|string $key
string|null $value

Return Value

$this

$this|string fragment(string|null $fragment = null)

Get / set the URL fragment to be appended to URLs.

Parameters

string|null $fragment

Return Value

$this|string

string|null nextPageUrl()

The URL for the next page, or null.

Return Value

string|null

string|null previousPageUrl()

Get the URL for the previous page, or null.

Return Value

string|null

array items()

Get all of the items being paginated.

Return Value

array

int firstItem()

Get the "index" of the first item being paginated.

Return Value

int

int lastItem()

Get the "index" of the last item being paginated.

Return Value

int

int perPage()

Determine how many items are being shown per page.

Return Value

int

int currentPage()

Determine the current page being paginated.

Return Value

int

bool hasPages()

Determine if there are enough items to split into multiple pages.

Return Value

bool

bool hasMorePages()

Determine if there are more items in the data store.

Return Value

bool

string|null path()

Get the base path for paginator generated URLs.

Return Value

string|null

bool isEmpty()

Determine if the list of items is empty or not.

Return Value

bool

bool isNotEmpty()

Determine if the list of items is not empty.

Return Value

bool

string render(string|null $view = null, array $data = [])

Render the paginator using a given view.

Parameters

string|null $view
array $data

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Contracts/Pagination/Paginator.html