class Illuminate / Pagination / LengthAwarePaginator
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

LengthAwarePaginator

Extends

Implements

Properties

protected

$total int

The total number of items before slicing.

Default: null
protected

$lastPage int

The last available page.

Default: null

Methods

public

__construct ( $items , $total , $perPage , $currentPage , array $options ) : void

Create a new paginator instance.

Parameters

  • $items mixed
  • $total int
  • $perPage int
  • $currentPage int|null
  • $options array
    (path, query, fragment, pageName)
protected

setCurrentPage ( $currentPage , $pageName ) : int

Get the current page for the request.

Parameters

  • $currentPage int
  • $pageName string
public

Render the paginator using the given view.

Parameters

  • $view string|null
  • $data array
public

render ( $view , $data ) : Htmlable

Render the paginator using the given view.

Parameters

  • $view string|null
  • $data array
public

linkCollection ( ) : Illuminate\...\Collection

Get the paginator links as a collection (for JSON responses).

protected

elements ( ) : array

Get the array of elements to pass to the view.

public

total ( ) : int

Get the total number of items being paginated.

public

hasMorePages ( ) : bool

Determine if there are more items in the data source.

public

nextPageUrl ( ) : string|null

Get the URL for the next page.

public

lastPage ( ) : int

Get the last page.

public

toArray ( ) : array

Get the instance as an array.

public

jsonSerialize ( ) : array

Convert the object into something JSON serializable.

public

toJson ( $options ) : string

Convert the object to its JSON representation.

Parameters

  • $options int