Arr
Uses
Methods
accessible ( $value ) : bool
Determine whether the given value is array accessible.
Parameters
- $value mixed
add ( $array , $key , $value ) : array
Add an element to an array using "dot" notation if it doesn't exist.
Parameters
- $array array
- $key string
- $value mixed
collapse ( $array ) : array
Collapse an array of arrays into a single array.
Parameters
- $array iterable
crossJoin ( $arrays ) : array
Cross join the given arrays, returning all possible permutations.
Parameters
- $arrays iterable
divide ( $array ) : array
Divide an array into two arrays. One with keys and the other with values.
Parameters
- $array array
dot ( $array , $prepend ) : array
Flatten a multi-dimensional associative array with dots.
Parameters
- $array iterable
- $prepend string
undot ( $array ) : array
Convert a flatten "dot" notation array into an expanded array.
Parameters
- $array iterable
except ( $array , $keys ) : array
Get all of the given array except for a specified array of keys.
Parameters
- $array array
- $keys array|string
exists ( $array , $key ) : bool
Determine if the given key exists in the provided array.
Parameters
- $array ArrayAccess |array
- $key string|int
first ( $array , callable $callback , $default ) : mixed
Return the first element in an array passing a given truth test.
Parameters
- $array iterable
- $callback callable|null
- $default mixed
last ( $array , callable $callback , $default ) : mixed
Return the last element in an array passing a given truth test.
Parameters
- $array array
- $callback callable|null
- $default mixed
flatten ( $array , $depth ) : array
Flatten a multi-dimensional array into a single level.
Parameters
- $array iterable
- $depth int
forget ( $array , $keys ) : void
Remove one or many array items from a given array using "dot" notation.
Parameters
- $array array
- $keys array|string
get ( $array , $key , $default ) : mixed
Get an item from an array using "dot" notation.
Parameters
- $array ArrayAccess |array
- $key string|int|null
- $default mixed
has ( $array , $keys ) : bool
Check if an item or items exist in an array using "dot" notation.
Parameters
- $array ArrayAccess |array
- $keys string|array
hasAny ( $array , $keys ) : bool
Determine if any of the keys exist in an array using "dot" notation.
Parameters
- $array ArrayAccess |array
- $keys string|array
isAssoc ( array $array ) : bool
Determines if an array is associative.
Parameters
- $array array
isList ( $array ) : bool
Determines if an array is a list.
Parameters
- $array array
only ( $array , $keys ) : array
Get a subset of the items from the given array.
Parameters
- $array array
- $keys array|string
pluck ( $array , $value , $key ) : array
Pluck an array of values from an array.
Parameters
- $array iterable
- $value string|array|int|null
- $key string|array|null
explodePluckParameters ( $value , $key ) : array
Explode the "value" and "key" arguments passed to "pluck".
Parameters
- $value string|array
- $key string|array|null
prepend ( $array , $value , $key ) : array
Push an item onto the beginning of an array.
Parameters
- $array array
- $value mixed
- $key mixed
pull ( $array , $key , $default ) : mixed
Get a value from the array, and remove it.
Parameters
- $array array
- $key string|int
- $default mixed
query ( $array ) : string
Convert the array into a query string.
Parameters
- $array array
random ( $array , $number , $preserveKeys ) : mixed
Get one or a specified number of random values from an array.
Parameters
- $array array
- $number int|null
- $preserveKeys bool|false
set ( $array , $key , $value ) : array
Set an array item to a given value using "dot" notation.
Parameters
- $array array
- $key string|null
- $value mixed
shuffle ( $array , $seed ) : array
Shuffle the given array and return the result.
Parameters
- $array array
- $seed int|null
sort ( $array , $callback ) : array
Sort the array using the given callback or "dot" notation.
Parameters
- $array array
- $callback callable|array|string|null
sortRecursive ( $array , $options , $descending ) : array
Recursively sort an array by keys and values.
Parameters
- $array array
- $options int
- $descending bool
toCssClasses ( $array ) : string
Conditionally compile classes from an array into a CSS class list.
Parameters
- $array array
where ( $array , callable $callback ) : array
Filter the array using the given callback.
Parameters
- $array array
- $callback callable
whereNotNull ( $array ) : array
Filter items where the value is not null.
Parameters
- $array array
wrap ( $value ) : array
If the given value is not an array and not null, wrap it in one.
Parameters
- $value mixed