Pagination
trait Pagination
Properties
| string | $paginationTheme | The pagination theme to use (e.g. 'tailwind', 'bootstrap'). |
|
| int|string | $perPage | Number of items per page. |
|
| string | $perPageDisplay | Display value for per page selector. |
|
| string[] | $perPageOptions | Available options for items per page. |
|
| bool | $with_pagination | Whether pagination is enabled. |
|
| int|null | $currentPageNumber | Current page number. |
|
| int|false | $forcePageNumber | Force a specific page number. |
Methods
Update the per-page display value.
Enable or disable pagination.
Set the default items per page.
Set available per-page options.
specific method to handle pagination logic.
Get paginated data for a specific page number.
Details
at line 66
void
updatedPerPageDisplay(string|int $value)
Update the per-page display value.
Handles the 'Total' option to show all records. Resets selection when page size changes.
at line 87
void
usePagination(bool $bool)
Enable or disable pagination.
at line 98
void
setPerPageDefault(int $number)
Set the default items per page.
at line 115
void
setPerPageOptions(array $array)
Set available per-page options.
at line 128
LengthAwarePaginator
paginateData()
specific method to handle pagination logic.
Applies search, filters, and sort logic to the query or collection, then paginates the result.
at line 198
LengthAwarePaginator
getPageData(int $currentPage)
Get paginated data for a specific page number.
Used for array-based data sources where we slice the collection manually.