Method |
Description |
|
__call ( $key, $arguments ) |
|
|
__debuginfo ( ) : array |
Improved var_dump() output |
|
__get ( $key ) |
|
|
__set ( $key, $value ) |
|
|
__toString ( ) : string |
Makes it possible to echo the entire object |
|
append ( string $key, mixed $object ) : Collection |
Appends an element to the data array |
|
chunk ( integer $size ) : object |
Creates chunks of the same size
The last chunk may be smaller |
|
count ( ) : integer |
Counts all elements in the array |
|
extractValue ( mixed $item, string $field ) : mixed |
Makes sure to provide a valid value for each filter method
no matter if an object or an array is given |
|
filter ( func $callback ) : Collection |
Filter the elements in the array by a callback function |
|
filterBy ( ) : Collection |
Filters the current collection by a field, operator and search value |
|
findBy ( string $key, mixed $value ) : mixed |
Find a single item by a key and value pair |
|
first ( ) : mixed |
Returns the first element from the array |
|
flip ( ) : Collection |
Returns the array in reverse order |
|
get ( $key, $default = null ) |
|
|
group ( callable $callback ) : object |
Groups the collection by a given callback |
|
groupBy ( string $field, $i = true ) : object |
Groups the collection by a given field |
|
has ( string $key ) : boolean |
Checks if an element is in the collection by key. |
|
indexOf ( mixed $needle ) : mixed |
Tries to find the index number for the given element |
|
keyOf ( mixed $needle ) : mixed |
Tries to find the key for the given element |
|
keys ( ) : array |
Returns an array of all keys in the collection |
|
last ( ) : mixed |
Returns the last element from the array |
|
limit ( integer $limit ) : Collection |
Returns a new collection with a limited number of elements |
|
map ( function $callback ) : Collection |
Map a function to each item in the collection |
|
merge ( $collection2 ) : Collection |
Returns a new combined collection |
|
not ( ) : Collection |
Returns a new collection without the given element(s) |
|
nth ( $n ) : mixed |
Returns the nth element from the array |
|
offset ( integer $offset ) : Collection |
Returns a new collection starting from the given offset |
|
paginate ( integer $limit, array $options = [] ) : object |
Add pagination |
|
pagination ( ) : object |
Get the previously added pagination object |
|
pluck ( string $field, $split = null, $unique = false ) : array |
Extracts all values for a single field into
a new array |
|
prepend ( string $key, mixed $object ) : Collection |
Prepends an element to the data array |
|
set ( $key, $value ) |
|
|
shuffle ( ) : object |
Shuffle all elements in the array |
|
slice ( integer $offset = null, integer $limit = null ) : Collection |
Returns a slice of the collection |
|
sortBy ( ) : Collection |
Sorts the collection by any number of fields |
|
toArray ( $callback = null ) : array |
Converts the current object into an array |
|
toJson ( ) : string |
Converts the current object into a json string |
|
without ( ) : Collection |
Returns a new collection without the given element(s) |
|