InteractsWithInput
trait InteractsWithInput
Traits
Methods
Dump the items.
Get all of the input and files for the request.
Retrieve data from the instance.
Determine if the instance contains any of the given keys.
Apply the callback if the instance contains the given key.
Determine if the instance contains a non-empty value for the given key.
Determine if the instance contains an empty value for the given key.
Determine if the instance contains a non-empty value for any of the given keys.
Apply the callback if the instance contains a non-empty value for the given key.
Apply the callback if the instance contains a valid enum value for the given key.
Determine if the instance is missing a given key.
Apply the callback if the instance is missing the given key.
Determine if the given key is an empty string for "filled".
Retrieve data from the instance as a Stringable instance.
Retrieve data from the instance as a Stringable instance.
Retrieve data as a boolean value.
Retrieve data as an integer value.
Retrieve data as a float value.
Retrieve data clamped between min and max values.
Retrieve data from the instance as a Carbon instance.
Retrieve data from the instance as a CarbonInterval instance.
Retrieve data from the instance as an enum.
Retrieve data from the instance as an array of enums.
Retrieve data from the instance as an array.
Retrieve data from the instance as a collection.
Get a subset containing the provided keys with values from the instance data.
Get all of the data except for a specified array of items.
Retrieve a server variable from the request.
Determine if a header is set on the request.
Retrieve a header from the request.
Get the bearer token from the request headers.
Get the keys for all of the input and files.
Retrieve an input item from the request.
Retrieve input from the request as a Fluent object instance.
Retrieve a query string item from the request.
Retrieve a request payload item from the request.
Determine if a cookie is set on the request.
Retrieve a cookie from the request.
Get an array of all of the files on the request.
Convert the given array of Symfony UploadedFiles to custom Hypervel UploadedFiles.
Determine if the uploaded data contains a file.
Check that the given file is a valid file instance.
Retrieve a file from the request.
Retrieve a parameter item from a given source.
Details
in
Dumpable at line 12
never
dd(mixed ...$args)
Dump the given arguments and terminate execution.
at line 289
InteractsWithInput
dump(mixed $keys = [])
Dump the items.
at line 83
array
all(mixed $keys = null)
Get all of the input and files for the request.
at line 263
protected mixed
data(string|null $key = null, mixed $default = null)
Retrieve data from the instance.
in
InteractsWithData at line 40
bool
exists(array|string $key)
Determine if the data contains a given key.
in
InteractsWithData at line 48
bool
has(array|string $key)
Determine if the data contains a given key.
in
InteractsWithData at line 67
bool
hasAny(array|string $keys)
Determine if the instance contains any of the given keys.
in
InteractsWithData at line 86
mixed
whenHas(string $key, callable $callback, callable|null $default = null)
Apply the callback if the instance contains the given key.
in
InteractsWithData at line 102
bool
filled(array|string $key)
Determine if the instance contains a non-empty value for the given key.
in
InteractsWithData at line 119
bool
isNotFilled(array|string $key)
Determine if the instance contains an empty value for the given key.
in
InteractsWithData at line 136
bool
anyFilled(array|string $keys)
Determine if the instance contains a non-empty value for any of the given keys.
in
InteractsWithData at line 160
mixed
whenFilled(string $key, callable $callback, callable|null $default = null)
Apply the callback if the instance contains a non-empty value for the given key.
in
InteractsWithData at line 185
mixed
whenEnum(string $key, string $enumClass, callable $callback, callable|null $default = null)
Apply the callback if the instance contains a valid enum value for the given key.
in
InteractsWithData at line 201
bool
missing(array|string $key)
Determine if the instance is missing a given key.
in
InteractsWithData at line 218
mixed
whenMissing(string $key, callable $callback, callable|null $default = null)
Apply the callback if the instance is missing the given key.
in
InteractsWithData at line 234
protected bool
isEmptyString(string $key)
Determine if the given key is an empty string for "filled".
in
InteractsWithData at line 246
Stringable
str(string $key, mixed $default = null, bool $strict = false)
Retrieve data from the instance as a Stringable instance.
in
InteractsWithData at line 256
Stringable
string(string $key, mixed $default = null, bool $strict = false)
Retrieve data from the instance as a Stringable instance.
When strict, values that are not strings, numbers, or Stringable objects return the default.
in
InteractsWithData at line 279
bool|null
boolean(string|null $key = null, Closure|bool|null $default = false, bool $strict = false)
Retrieve data as a boolean value.
Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. When strict, unrecognized or empty values return the default.
in
InteractsWithData at line 301
int|null
integer(string $key, Closure|int|null $default = 0, bool $strict = false)
Retrieve data as an integer value.
When strict, values that are not valid integers return the default.
in
InteractsWithData at line 328
float|null
float(string $key, Closure|float|null $default = 0.0, bool $strict = false)
Retrieve data as a float value.
When strict, values that are not valid numbers return the default.
in
InteractsWithData at line 347
int|float
clamp(string $key, int|float $min, int|float $max, int|float $default = 0)
Retrieve data clamped between min and max values.
in
InteractsWithData at line 365
CarbonInterface|null
date(string $key, string|null $format = null, UnitEnum|string|null $tz = null)
Retrieve data from the instance as a Carbon instance.
in
InteractsWithData at line 383
CarbonInterval|null
interval(string $key, Unit|string|null $unit = null)
Retrieve data from the instance as a CarbonInterval instance.
in
InteractsWithData at line 410
mixed
enum(string $key, string $enumClass, mixed $default = null)
Retrieve data from the instance as an enum.
in
InteractsWithData at line 427
array
enums(string $key, string $enumClass)
Retrieve data from the instance as an array of enums.
in
InteractsWithData at line 442
array
array(array|string|null $key = null)
Retrieve data from the instance as an array.
in
InteractsWithData at line 452
Collection
collect(array|string|null $key = null)
Retrieve data from the instance as a collection.
in
InteractsWithData at line 460
array
only(mixed $keys)
Get a subset containing the provided keys with values from the instance data.
in
InteractsWithData at line 482
array
except(mixed $keys)
Get all of the data except for a specified array of items.
at line 29
mixed
server(string|null $key = null, mixed $default = null)
Retrieve a server variable from the request.
at line 37
bool
hasHeader(string $key)
Determine if a header is set on the request.
at line 49
string|array|null
header(string|null $key = null, string|array|null $default = null)
Retrieve a header from the request.
A header stored with a null value returns null even when a default is given.
at line 57
string|null
bearerToken()
Get the bearer token from the request headers.
at line 75
array
keys()
Get the keys for all of the input and files.
at line 105
mixed
input(string|null $key = null, mixed $default = null)
Retrieve an input item from the request.
at line 117
Fluent
fluent(array|string|null $key = null, array $default = [])
Retrieve input from the request as a Fluent object instance.
at line 132
mixed
query(string|null $key = null, mixed $default = null)
Retrieve a query string item from the request.
at line 145
mixed
post(string|null $key = null, mixed $default = null)
Retrieve a request payload item from the request.
at line 153
bool
hasCookie(string $key)
Determine if a cookie is set on the request.
at line 166
mixed
cookie(string|null $key = null, mixed $default = null)
Retrieve a cookie from the request.
at line 178
array
allFiles()
Get an array of all of the files on the request.
Nested inputs give nested arrays, and an input submitted without a file is null.
at line 193
protected array
convertUploadedFiles(array $files)
Convert the given array of Symfony UploadedFiles to custom Hypervel UploadedFiles.
at line 209
bool
hasFile(string $key)
Determine if the uploaded data contains a file.
at line 228
protected bool
isValidFile(mixed $file)
Check that the given file is a valid file instance.
at line 241
mixed
file(string|null $key = null, mixed $default = null)
Retrieve a file from the request.
at line 249
Image|null
image(string $key)
Retrieve a file from the request as an image instance.
at line 271
protected mixed
retrieveItem(string $source, string|null $key, mixed $default)
Retrieve a parameter item from a given source.