Request
class Request implements ArrayAccess
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected array | $data | The decoded payload for the request. |
|
| protected array | $attributes | The attribute data passed when building the PendingRequest. |
Methods
Mix another object into the class.
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.
No description
No description
Get the attribute data from the request.
Set the request's attribute data.
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.
Flush all static state.
Details
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 32
__construct(RequestInterface $request)
Create a new request instance.
at line 39
string
method()
Get the request method.
at line 47
string
url()
Get the URL of the request.
at line 55
Uri
uri()
Get the request URI as a URI instance.
at line 63
bool
hasHeader(string $key, mixed $value = null)
Determine if the request has a given header.
at line 83
bool
hasHeaders(array|string $headers)
Determine if the request has the given headers.
at line 101
array
header(string $key)
Get the values for the header with the given name.
at line 109
array
headers()
Get the request headers.
at line 117
string
body()
Get the body of the request.
at line 125
bool
hasFile(string $name, string|null $value = null, string|null $filename = null)
Determine if the request contains the given file.
at line 141
array
data()
Get the request's data (form parameters or JSON).
at line 156
protected array
parameters()
Get the request's form parameters.
at line 170
protected array
json()
Get the JSON decoded body of the request.
at line 182
bool
isForm()
Determine if the request is simple form data.
at line 190
bool
isJson()
Determine if the request is JSON.
at line 199
bool
isMultipart()
Determine if the request is multipart.
at line 208
Request
withData(array $data)
Set the decoded data on the request.
at line 215
array
query()
No description
at line 222
Request
withQuery(array $query = [])
No description
at line 231
Request
withoutQuery(array $keys = [])
No description
at line 245
array
attributes()
Get the attribute data from the request.
at line 253
Request
setRequestAttributes(array $attributes)
Set the request's attribute data.
at line 263
RequestInterface
toPsrRequest()
Get the underlying PSR compliant request instance.
at line 273
bool
offsetExists(string $offset)
Determine if the given offset exists.
at line 283
mixed
offsetGet(string $offset)
Get the value for a given offset.
at line 295
void
offsetSet(string $offset, mixed $value)
Set the value at the given offset.
at line 307
void
offsetUnset(string $offset)
Unset the value at the given offset.
at line 315
static void
flushState()
Flush all static state.