class Get extends Mutator (View source)

Get value from array or object by key using dot-notation.

If the key is an array, it will be treated as a path to the value.

Ported and adapted from illuminate/collections helper data_get.

Methods

__construct(array|int|string $key, mixed $default = null)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Get
make(array|int|string $key, mixed $default = null)

No description

mixed
mutate(mixed $value)

Mutate the input value.

Details

__construct(array|int|string $key, mixed $default = null)

No description

Parameters

array|int|string $key

The key to get

mixed $default

The default value to return if the key does not exist. Can be callable (defaults to null).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Get make(array|int|string $key, mixed $default = null)

No description

Parameters

array|int|string $key

The key to get

mixed $default

The default value to return if the key does not exist. Can be callable (defaults to null).

Return Value

Get

mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed