final class InputBag (View source)

Provides read-only access to a named collection of request input values.

Methods

__construct(array $items = [])

Stores the input map without coercing its values.

array
all()

Returns the complete input map.

array
bool
has(string $key)

Reports whether the key exists, including keys whose value is null.

bool
mixed
get(string $key, mixed $default = null)

Returns an input value or the supplied fallback when the key is absent or null.

mixed

Details

__construct

__construct(array $items = [])

Stores the input map without coercing its values.

Parameters

array $items

all

array all()

Returns the complete input map.

Return Value

array

has

bool has(string $key)

Reports whether the key exists, including keys whose value is null.

Parameters

string $key

Return Value

bool

get

mixed get(string $key, mixed $default = null)

Returns an input value or the supplied fallback when the key is absent or null.

Parameters

string $key
mixed $default

Return Value

mixed