Request
class Request extends Request (View source)
Properties
protected string | $json | The decoded JSON content for the request. |
|
protected Store | $sessionStore | The Illuminate session store implementation. |
Methods
Return the Request instance.
Get the request method.
Get the root URL for the application.
Get the URL (no query string) for the request.
Get the full URL for the request.
Get the current path info for the request.
Get the current encoded path info for the request.
Get a segment from the URI (1 based index).
Get all of the segments for the request path.
Determine if the current request URI matches a pattern.
Determine if the request is the result of an AJAX call.
Determine if the request is over HTTPS.
Returns the client IP address.
Returns the client IP addresses.
Determine if the request contains a given input item key.
Determine if the request contains a non-empty value for an input item.
Determine if the given input key is an empty string for "has".
Get all of the input and files for the request.
Retrieve an input item from the request.
Get a subset of the items from the input data.
Get all of the input except for a specified array of items.
Retrieve a query string item from the request.
Determine if a cookie is set on the request.
Retrieve a cookie from the request.
Retrieve a file from the request.
Determine if the uploaded data contains a file.
Check that the given file is a valid file instance.
Retrieve a header from the request.
Retrieve a server variable from the request.
Retrieve an old input item.
Flash the input for the current request to the session.
Flash only some of the input to the session.
Flash only some of the input to the session.
Flush all of the old input from the session.
Retrieve a parameter item from a given source.
Merge new input into the current request's input array.
Replace the input for the current request.
Get the JSON payload for the request.
Get the input source for the request.
Determine if the request is sending JSON.
Determine if the current request is asking for JSON in return.
Get the data format expected in the response.
Create an Illuminate request from a Symfony instance.
Details
$this
instance()
Return the Request instance.
string
method()
Get the request method.
string
root()
Get the root URL for the application.
string
url()
Get the URL (no query string) for the request.
string
fullUrl()
Get the full URL for the request.
string
path()
Get the current path info for the request.
string
decodedPath()
Get the current encoded path info for the request.
string
segment(string $index, mixed $default = null)
Get a segment from the URI (1 based index).
array
segments()
Get all of the segments for the request path.
bool
is()
Determine if the current request URI matches a pattern.
bool
ajax()
Determine if the request is the result of an AJAX call.
bool
secure()
Determine if the request is over HTTPS.
string
ip()
Returns the client IP address.
array
ips()
Returns the client IP addresses.
bool
exists(string|array $key)
Determine if the request contains a given input item key.
bool
has(string|array $key)
Determine if the request contains a non-empty value for an input item.
protected bool
isEmptyString(string $key)
Determine if the given input key is an empty string for "has".
array
all()
Get all of the input and files for the request.
string
input(string $key = null, mixed $default = null)
Retrieve an input item from the request.
array
only(array $keys)
Get a subset of the items from the input data.
array
except(array $keys)
Get all of the input except for a specified array of items.
string|array
query(string $key = null, mixed $default = null)
Retrieve a query string item from the request.
bool
hasCookie(string $key)
Determine if a cookie is set on the request.
string
cookie(string $key = null, mixed $default = null)
Retrieve a cookie from the request.
UploadedFile|array
file(string $key = null, mixed $default = null)
Retrieve a file from the request.
bool
hasFile(string $key)
Determine if the uploaded data contains a file.
protected bool
isValidFile(mixed $file)
Check that the given file is a valid file instance.
string
header(string $key = null, mixed $default = null)
Retrieve a header from the request.
string
server(string $key = null, mixed $default = null)
Retrieve a server variable from the request.
mixed
old(string $key = null, mixed $default = null)
Retrieve an old input item.
void
flash(string $filter = null, array $keys = array())
Flash the input for the current request to the session.
void
flashOnly($keys)
Flash only some of the input to the session.
void
flashExcept($keys)
Flash only some of the input to the session.
void
flush()
Flush all of the old input from the session.
protected string
retrieveItem(string $source, string $key, mixed $default)
Retrieve a parameter item from a given source.
void
merge(array $input)
Merge new input into the current request's input array.
void
replace(array $input)
Replace the input for the current request.
mixed
json(string $key = null, mixed $default = null)
Get the JSON payload for the request.
protected ParameterBag
getInputSource()
Get the input source for the request.
bool
isJson()
Determine if the request is sending JSON.
bool
wantsJson()
Determine if the current request is asking for JSON in return.
string
format(string $default = 'html')
Get the data format expected in the response.
static Request
createFromBase(Request $request)
Create an Illuminate request from a Symfony instance.
Store
session()
Get the session associated with the request.