class PaginatedCollection extends Collection (View source)

Properties

protected int $total

The total number of items.

Methods

paginate(int $perPage = 15, int|null $page = null, string $pageName = 'page', bool $prepaginated = false)

Paginate the current collection.

paginator(Collection $items, int $total, int $perPage, int|null $currentPage, string $pageName)

Create a new length-aware paginator instance.

int|null
total(int|null $total = null)

Get or set the total amount.

Details

LengthAwarePaginator paginate(int $perPage = 15, int|null $page = null, string $pageName = 'page', bool $prepaginated = false)

Paginate the current collection.

Parameters

int $perPage
int|null $page
string $pageName
bool $prepaginated

Return Value

LengthAwarePaginator

protected LengthAwarePaginator paginator(Collection $items, int $total, int $perPage, int|null $currentPage, string $pageName)

Create a new length-aware paginator instance.

Parameters

Collection $items
int $total
int $perPage
int|null $currentPage
string $pageName

Return Value

LengthAwarePaginator

int|null total(int|null $total = null)

Get or set the total amount.

Parameters

int|null $total

Return Value

int|null