class Request extends Request implements Arrayable, ArrayAccess (View source)
InteractsWithContentTypes |
InteractsWithFlashData |
InteractsWithInput |
Macroable |
static bool | matchesType(string $actual, string $type) Determine if the given content types match. | from InteractsWithContentTypes |
bool | isJson() Determine if the request is sending JSON. | from InteractsWithContentTypes |
bool | expectsJson() Determine if the current request probably expects a JSON response. | from InteractsWithContentTypes |
bool | wantsJson() Determine if the current request is asking for JSON in return. | from InteractsWithContentTypes |
bool | accepts(string|array $contentTypes) Determines whether the current requests accepts a given content type. | from InteractsWithContentTypes |
string|null | prefers(string|array $contentTypes) Return the most suitable content type from the given array based on content negotiation. | from InteractsWithContentTypes |
bool | acceptsJson() Determines whether a request accepts JSON. | from InteractsWithContentTypes |
bool | acceptsHtml() Determines whether a request accepts HTML. | from InteractsWithContentTypes |
string | format(string $default = 'html') Get the data format expected in the response. | from InteractsWithContentTypes |
string|array | old(string $key = null, string|array|null $default = null) Retrieve an old input item. | from InteractsWithFlashData |
void | flash() Flash the input for the current request to the session. | from InteractsWithFlashData |
void | flashOnly(array|mixed $keys) Flash only some of the input to the session. | from InteractsWithFlashData |
void | flashExcept(array|mixed $keys) Flash only some of the input to the session. | from InteractsWithFlashData |
void | flush() Flush all of the old input from the session. | from InteractsWithFlashData |
string|array | server(string $key = null, string|array|null $default = null) Retrieve a server variable from the request. | from InteractsWithInput |
bool | hasHeader(string $key) Determine if a header is set on the request. | from InteractsWithInput |
string|array | header(string $key = null, string|array|null $default = null) Retrieve a header from the request. | from InteractsWithInput |
string|null | bearerToken() Get the bearer token from the request headers. | from InteractsWithInput |
bool | exists(string|array $key) Determine if the request contains a given input item key. | from InteractsWithInput |
bool | has(string|array $key) Determine if the request contains a non-empty value for an input item. | from InteractsWithInput |
array | all() Get all of the input and files for the request. | from InteractsWithInput |
string|array | input(string $key = null, string|array|null $default = null) Retrieve an input item from the request. | from InteractsWithInput |
array | only(array|mixed $keys) Get a subset containing the provided keys with values from the input data. | from InteractsWithInput |
array | except(array|mixed $keys) Get all of the input except for a specified array of items. | from InteractsWithInput |
array | intersect(array|mixed $keys) Intersect an array of items with the input data. | from InteractsWithInput |
string|array | query(string $key = null, string|array|null $default = null) Retrieve a query string item from the request. | from InteractsWithInput |
bool | hasCookie(string $key) Determine if a cookie is set on the request. | from InteractsWithInput |
string|array | cookie(string $key = null, string|array|null $default = null) Retrieve a cookie from the request. | from InteractsWithInput |
array | allFiles() Get an array of all of the files on the request. | from InteractsWithInput |
bool | hasFile(string $key) Determine if the uploaded data contains a file. | from InteractsWithInput |
UploadedFile|array|null | file(string $key = null, mixed $default = null) Retrieve a file from the request. | from InteractsWithInput |
static void | macro(string $name, callable $macro) Register a custom macro. | from Macroable |
static bool | hasMacro(string $name) Checks if macro is registered. | from Macroable |
static mixed | __callStatic(string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
mixed | __call(string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
static Request | capture() Create a new Illuminate HTTP request from server variables. | |
$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 | fullUrlWithQuery(array $query) Get the full URL for the request with the added query string parameters. | |
string | path() Get the current path info for the request. | |
string | decodedPath() Get the current encoded path info for the request. | |
string|null | segment(int $index, string|null $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 | fullUrlIs() Determine if the current request URL and query string matches a pattern. | |
bool | ajax() Determine if the request is the result of an AJAX call. | |
bool | pjax() Determine if the request is the result of an PJAX call. | |
bool | secure() Determine if the request is over HTTPS. | |
string | ip() Returns the client IP address. | |
array | ips() Returns the client IP addresses. | |
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. | |
static Request | createFromBase(Request $request) Create an Illuminate request from a Symfony instance. | |
duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) {@inheritdoc} | ||
Store | session() Get the session associated with the request. | |
void | setLaravelSession(Session $session) Set the session instance on the request. | |
mixed | user(string|null $guard = null) Get the user making the request. | |
Route|object|string | route(string|null $param = null) Get the route handling the request. | |
string | fingerprint() Get a unique fingerprint for the request / route / IP address. | |
$this | setJson(array $json) Set the JSON payload for the request. | |
Closure | getUserResolver() Get the user resolver callback. | |
$this | setUserResolver(Closure $callback) Set the user resolver callback. | |
Closure | getRouteResolver() Get the route resolver callback. | |
$this | setRouteResolver(Closure $callback) Set the route resolver callback. | |
array | toArray() Get all of the input and files for the request. | |
bool | offsetExists(string $offset) Determine if the given offset exists. | |
mixed | offsetGet(string $offset) Get the value at the given offset. | |
void | offsetSet(string $offset, mixed $value) Set the value at the given offset. | |
void | offsetUnset(string $offset) Remove the value at the given offset. | |
bool | __isset(string $key) Check if an input element is set on the request. | |
mixed | __get(string $key) Get an input element from the request. |
Determine if the given content types match.
Determine if the request is sending JSON.
Determine if the current request probably expects a JSON response.
Determine if the current request is asking for JSON in return.
Determines whether the current requests accepts a given content type.
Return the most suitable content type from the given array based on content negotiation.
Determines whether a request accepts JSON.
Determines whether a request accepts HTML.
Get the data format expected in the response.
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 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.
Determine if the request contains a given input item key.
Determine if the request contains a non-empty value for an input item.
Get all of the input and files for the request.
Retrieve an input item from the request.
Get a subset containing the provided keys with values from the input data.
Get all of the input except for a specified array of items.
Intersect an array of items with the input data.
Retrieve a query string 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.
Determine if the uploaded data contains a file.
Retrieve a file from the request.
Register a custom macro.
Checks if macro is registered.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new Illuminate HTTP request from server variables.
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 full URL for the request with the added query string parameters.
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 current request URL and query string matches a pattern.
Determine if the request is the result of an AJAX call.
Determine if the request is the result of an PJAX call.
Determine if the request is over HTTPS.
Returns the client IP address.
Returns the client IP addresses.
Merge new input into the current request's input array.
Replace the input for the current request.
Get the JSON payload for the request.
Create an Illuminate request from a Symfony instance.
{@inheritdoc}
Get the session associated with the request.
Set the session instance on the request.
Get the user making the request.
Get the route handling the request.
Get a unique fingerprint for the request / route / IP address.
Set the JSON payload for the request.
Get the user resolver callback.
Set the user resolver callback.
Get the route resolver callback.
Set the route resolver callback.
Get all of the input and files for the request.
Determine if the given offset exists.
Get the value at the given offset.
Set the value at the given offset.
Remove the value at the given offset.
Check if an input element is set on the request.
Get an input element from the request.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Http/Request.html