class Request implements ArrayAccess (View source)
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected RequestInterface | $request | The underlying PSR request. | |
| protected array | $data | The decoded payload for the request. |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | 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 |
| void | __construct(RequestInterface $request)
Create a new request instance. | |
| string | method()
Get the request method. | |
| string | url()
Get the URL of the request. | |
| bool | hasHeader(string $key, mixed $value = null)
Determine if the request has a given header. | |
| bool | hasHeaders(array|string $headers)
Determine if the request has the given headers. | |
| array | header(string $key)
Get the values for the header with the given name. | |
| array | headers()
Get the request headers. | |
| string | body()
Get the body of the request. | |
| bool | hasFile(string $name, string|null $value = null, string|null $filename = null)
Determine if the request contains the given file. | |
| array | data()
Get the request's data (form parameters or JSON). | |
| array | parameters()
Get the request's form parameters. | |
| array | json()
Get the JSON decoded body of the request. | |
| bool | isForm()
Determine if the request is simple form data. | |
| bool | isJson()
Determine if the request is JSON. | |
| bool | isMultipart()
Determine if the request is multipart. | |
| $this | withData(array $data)
Set the decoded data on the request. | |
| RequestInterface | toPsrRequest()
Get the underlying PSR compliant request instance. | |
| bool | offsetExists(string $offset)
Determine if the given offset exists. | |
| mixed | offsetGet(string $offset)
Get the value for a given offset. | |
| void | offsetSet(string $offset, mixed $value)
Set the value at the given offset. | |
| void | offsetUnset(string $offset)
Unset the value at the given offset. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new request instance.
Get the request method.
Get the URL of the request.
Determine if the request has a given header.
Determine if the request has the given headers.
Get the values for the header with the given name.
Get the request headers.
Get the body of the request.
Determine if the request contains the given file.
Get the request's data (form parameters or JSON).
Get the request's form parameters.
Get the JSON decoded body of the request.
Determine if the request is simple form data.
Determine if the request is JSON.
Determine if the request is multipart.
Set the decoded data on the request.
Get the underlying PSR compliant request instance.
Determine if the given offset exists.
Get the value for a given offset.
Set the value at the given offset.
Unset the value at the given offset.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Http/Client/Request.html