Properties

$items

$items : \Illuminate\Support\Collection

All of the items being paginated.

Type

\Illuminate\Support\Collection

$perPage

$perPage : integer

The number of items to be shown per page.

Type

integer

$currentAfter

$currentAfter : mixed|null

The value of a primary key of the model after which items are being "viewed".

Type

mixed|null

$path

$path : string

The base path to assign to all URLs.

Type

string

$query

$query : array

The query parameters to add to all URLs.

Type

array

$fragment

$fragment : string|null

The URL fragment to add to all URLs.

Type

string|null

$afterName

$afterName : string

The query string variable used to store the value of the primary key of the 'after' model.

Type

string

Methods

__construct()

__construct(\Illuminate\Support\Collection  $items, integer  $perPage, mixed|null  $after = null) 

AfterPaginator constructor.

Parameters

\Illuminate\Support\Collection $items
integer $perPage
mixed|null $after

fromQuery()

fromQuery(\Illuminate\Database\Eloquent\Builder  $query, integer  $perPage, mixed|null  $after = null) : \App\Eloquent\Order\AfterPaginator

Paginate a database query

Parameters

\Illuminate\Database\Eloquent\Builder $query
integer $perPage
mixed|null $after

Returns

\App\Eloquent\Order\AfterPaginator

nextPageUrl()

nextPageUrl() : string|null

The URL for the next page, or null.

Returns

string|null

url()

url(mixed|null  $after = null) : string

Get the URL for a given timestamp.

Parameters

mixed|null $after

Returns

string

fragment()

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

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

Parameters

string|null $fragment

Returns

$this|string|null

appends()

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

Add a set of query string values to the paginator.

Parameters

array|string $key
string|null $value

Returns

$this

items()

items() : array

Get the slice of items being paginated.

Returns

array

setPath()

setPath(string  $path) : $this

Set the base path to assign to all URLs.

Parameters

string $path

Returns

$this

previousPageUrl()

previousPageUrl() 

Not implemented.

firstItem()

firstItem() 

Not implemented.

lastItem()

lastItem() 

Not implemented.

perPage()

perPage() : integer

Determine how many items are being shown per page.

Returns

integer

currentPage()

currentPage() 

Not implemented.

hasPages()

hasPages() : boolean

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

Returns

boolean

hasMorePages()

hasMorePages() : boolean

Determine if there is more items in the data store.

Returns

boolean

isEmpty()

isEmpty() : boolean

Determine if the list of items is empty or not.

Returns

boolean

isNotEmpty()

isNotEmpty() : boolean

Determine if the list of items is not empty.

Returns

boolean

render()

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

Render the paginator using a given view.

Parameters

string|null $view
array $data

Returns

string

getCollection()

getCollection() : \Illuminate\Support\Collection

Get the paginator's underlying collection.

Returns

\Illuminate\Support\Collection

__call()

__call(string  $method, array  $parameters) : mixed

Make dynamic calls into the collection.

Parameters

string $method
array $parameters

Returns

mixed

toArray()

toArray() : array

Get the instance as an array.

Returns

array

jsonSerialize()

jsonSerialize() : array

Convert the object into something JSON serializable.

Returns

array

toJson()

toJson(integer  $options) : string

Convert the object to its JSON representation.

Parameters

integer $options

Returns

string

appendArray()

appendArray(array  $keys) : $this

Add an array of query string values.

Parameters

array $keys

Returns

$this

addQuery()

addQuery(string  $key, string  $value) : $this

Add a query string value to the paginator.

Parameters

string $key
string $value

Returns

$this

buildFragment()

buildFragment() : string

Build the full fragment portion of a URL.

Returns

string