InteractsWithInput
Table of Contents
- all() : array<string|int, mixed>
- Get all of the input and files for the request.
- allFiles() : array<string|int, mixed>
- Get an array of all of the files on the request.
- bearerToken() : string|null
- Get the bearer token from the request headers.
- cookie() : string|array<string|int, mixed>
- Retrieve a cookie from the request.
- except() : array<string|int, mixed>
- Get all of the input except for a specified array of items.
- exists() : bool
- Determine if the request contains a given input item key.
- file() : UploadedFile|array<string|int, mixed>|null
- Retrieve a file from the request.
- filled() : bool
- Determine if the request contains a non-empty value for an input item.
- has() : bool
- Determine if the request contains a given input item key.
- hasAny() : bool
- Determine if the request contains any of the given inputs.
- hasCookie() : bool
- Determine if a cookie is set on the request.
- hasFile() : bool
- Determine if the uploaded data contains a file.
- hasHeader() : bool
- Determine if a header is set on the request.
- header() : string|array<string|int, mixed>
- Retrieve a header from the request.
- input() : string|array<string|int, mixed>
- Retrieve an input item from the request.
- keys() : array<string|int, mixed>
- Get the keys for all of the input and files.
- only() : array<string|int, mixed>
- Get a subset containing the provided keys with values from the input data.
- post() : string|array<string|int, mixed>
- Retrieve a request payload item from the request.
- query() : string|array<string|int, mixed>
- Retrieve a query string item from the request.
- server() : string|array<string|int, mixed>
- Retrieve a server variable from the request.
- convertUploadedFiles() : array<string|int, mixed>
- Convert the given array of Symfony UploadedFiles to custom Laravel UploadedFiles.
- isEmptyString() : bool
- Determine if the given input key is an empty string for "has".
- isValidFile() : bool
- Check that the given file is a valid file instance.
- retrieveItem() : string|array<string|int, mixed>
- Retrieve a parameter item from a given source.
Methods
all()
Get all of the input and files for the request.
public
all([array<string|int, mixed>|mixed $keys = null ]) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed>|mixed = null
Return values
array<string|int, mixed> —allFiles()
Get an array of all of the files on the request.
public
allFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —bearerToken()
Get the bearer token from the request headers.
public
bearerToken() : string|null
Return values
string|null —cookie()
Retrieve a cookie from the request.
public
cookie([string $key = null ][, string|array<string|int, mixed>|null $default = null ]) : string|array<string|int, mixed>
Parameters
- $key : string = null
- $default : string|array<string|int, mixed>|null = null
Return values
string|array<string|int, mixed> —except()
Get all of the input except for a specified array of items.
public
except(array<string|int, mixed>|mixed $keys) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed>|mixed
Return values
array<string|int, mixed> —exists()
Determine if the request contains a given input item key.
public
exists(string|array<string|int, mixed> $key) : bool
Parameters
- $key : string|array<string|int, mixed>
Return values
bool —file()
Retrieve a file from the request.
public
file([string $key = null ][, mixed $default = null ]) : UploadedFile|array<string|int, mixed>|null
Parameters
- $key : string = null
- $default : mixed = null
Return values
UploadedFile|array<string|int, mixed>|null —filled()
Determine if the request contains a non-empty value for an input item.
public
filled(string|array<string|int, mixed> $key) : bool
Parameters
- $key : string|array<string|int, mixed>
Return values
bool —has()
Determine if the request contains a given input item key.
public
has(string|array<string|int, mixed> $key) : bool
Parameters
- $key : string|array<string|int, mixed>
Return values
bool —hasAny()
Determine if the request contains any of the given inputs.
public
hasAny(mixed ...$keys) : bool
Parameters
- $keys : mixed
Return values
bool —hasCookie()
Determine if a cookie is set on the request.
public
hasCookie(string $key) : bool
Parameters
- $key : string
Return values
bool —hasFile()
Determine if the uploaded data contains a file.
public
hasFile(string $key) : bool
Parameters
- $key : string
Return values
bool —hasHeader()
Determine if a header is set on the request.
public
hasHeader(string $key) : bool
Parameters
- $key : string
Return values
bool —header()
Retrieve a header from the request.
public
header([string $key = null ][, string|array<string|int, mixed>|null $default = null ]) : string|array<string|int, mixed>
Parameters
- $key : string = null
- $default : string|array<string|int, mixed>|null = null
Return values
string|array<string|int, mixed> —input()
Retrieve an input item from the request.
public
input([string $key = null ][, string|array<string|int, mixed>|null $default = null ]) : string|array<string|int, mixed>
Parameters
- $key : string = null
- $default : string|array<string|int, mixed>|null = null
Return values
string|array<string|int, mixed> —keys()
Get the keys for all of the input and files.
public
keys() : array<string|int, mixed>
Return values
array<string|int, mixed> —only()
Get a subset containing the provided keys with values from the input data.
public
only(array<string|int, mixed>|mixed $keys) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed>|mixed
Return values
array<string|int, mixed> —post()
Retrieve a request payload item from the request.
public
post([string $key = null ][, string|array<string|int, mixed>|null $default = null ]) : string|array<string|int, mixed>
Parameters
- $key : string = null
- $default : string|array<string|int, mixed>|null = null
Return values
string|array<string|int, mixed> —query()
Retrieve a query string item from the request.
public
query([string $key = null ][, string|array<string|int, mixed>|null $default = null ]) : string|array<string|int, mixed>
Parameters
- $key : string = null
- $default : string|array<string|int, mixed>|null = null
Return values
string|array<string|int, mixed> —server()
Retrieve a server variable from the request.
public
server([string $key = null ][, string|array<string|int, mixed>|null $default = null ]) : string|array<string|int, mixed>
Parameters
- $key : string = null
- $default : string|array<string|int, mixed>|null = null
Return values
string|array<string|int, mixed> —convertUploadedFiles()
Convert the given array of Symfony UploadedFiles to custom Laravel UploadedFiles.
protected
convertUploadedFiles(array<string|int, mixed> $files) : array<string|int, mixed>
Parameters
- $files : array<string|int, mixed>
Return values
array<string|int, mixed> —isEmptyString()
Determine if the given input key is an empty string for "has".
protected
isEmptyString(string $key) : bool
Parameters
- $key : string
Return values
bool —isValidFile()
Check that the given file is a valid file instance.
protected
isValidFile(mixed $file) : bool
Parameters
- $file : mixed
Return values
bool —retrieveItem()
Retrieve a parameter item from a given source.
protected
retrieveItem(string $source, string $key, string|array<string|int, mixed>|null $default) : string|array<string|int, mixed>
Parameters
- $source : string
- $key : string
- $default : string|array<string|int, mixed>|null