RedirectResponse
class RedirectResponse extends RedirectResponse
Traits
Properties
| mixed | $original | The original content of the response. |
from ResponseTrait |
| Throwable|null | $exception | The exception that triggered the error response (if applicable). |
from ResponseTrait |
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected Request|null | $request | The request instance. |
|
| protected Store|null | $session | The session store instance. |
Methods
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Get the original response content.
Set a header on the Response.
Add an array of headers to the response.
Remove a header(s) from the response.
Expire a cookie when sending the response.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically bind flash data in the session.
Flash a piece of data to the session.
Add multiple cookies to the response.
Flash an array of input to the session.
Remove all uploaded files from the given input array.
Flash only the specified input keys to the session.
Flash all input except the specified keys to the session.
Flash a container of errors to the session.
Parse the given errors into an appropriate value.
Add a fragment identifier to the URL.
Remove any fragment identifier from the response URL.
Enforce that the redirect target must have the same host as the current request.
Get the request instance.
Get the session store instance.
Flush all static state.
Details
in
ForwardsCalls at line 22
protected mixed
forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
in
ForwardsCalls at line 52
protected mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself.
in
ForwardsCalls at line 66
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
in
ResponseTrait at line 26
int
status()
Get the status code for the response.
in
ResponseTrait at line 34
string
statusText()
Get the status text for the response.
in
ResponseTrait at line 42
string
content()
Get the content of the response.
at line 181
mixed
getOriginalContent()
Get the original response content.
in
ResponseTrait at line 62
ResponseTrait
header(string $key, array|string $values, bool $replace = true)
Set a header on the Response.
in
ResponseTrait at line 74
ResponseTrait
withHeaders(HeaderBag|array $headers)
Add an array of headers to the response.
in
ResponseTrait at line 92
ResponseTrait
withoutHeader(array|string $key)
Remove a header(s) from the response.
in
ResponseTrait at line 106
ResponseTrait
cookie(mixed $cookie)
Add a cookie to the response.
in
ResponseTrait at line 116
ResponseTrait
withCookie(mixed $cookie)
Add a cookie to the response.
in
ResponseTrait at line 132
ResponseTrait
withoutCookie(mixed $cookie, string|null $path = null, string|null $domain = null)
Expire a cookie when sending the response.
in
ResponseTrait at line 146
string|null
getCallback()
Get the callback of the response.
in
ResponseTrait at line 156
ResponseTrait
withException(Throwable $e)
Set the exception to attach to the response.
in
ResponseTrait at line 168
never
throwResponse()
Throw the response in a HttpResponseException instance.
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.
at line 235
mixed
__call(string $method, array $parameters)
Dynamically bind flash data in the session.
at line 39
RedirectResponse
with(string|array $key, mixed $value = null)
Flash a piece of data to the session.
at line 53
RedirectResponse
withCookies(array $cookies)
Add multiple cookies to the response.
at line 65
RedirectResponse
withInput(array|null $input = null)
Flash an array of input to the session.
at line 77
protected array
removeFilesFromInput(array $input)
Remove all uploaded files from the given input array.
at line 95
RedirectResponse
onlyInput()
Flash only the specified input keys to the session.
at line 103
RedirectResponse
exceptInput()
Flash all input except the specified keys to the session.
at line 111
RedirectResponse
withErrors(MessageProvider|array|string $provider, string $key = 'default')
Flash a container of errors to the session.
at line 132
protected MessageBag
parseErrors(MessageProvider|array|string $provider)
Parse the given errors into an appropriate value.
at line 144
RedirectResponse
withFragment(string $fragment)
Add a fragment identifier to the URL.
at line 153
RedirectResponse
withoutFragment()
Remove any fragment identifier from the response URL.
at line 161
RedirectResponse
enforceSameOrigin(string $fallback, bool $validateScheme = true, bool $validatePort = true)
Enforce that the redirect target must have the same host as the current request.
at line 189
Request|null
getRequest()
Get the request instance.
at line 197
RedirectResponse
setRequest(Request $request)
Set the request instance.
at line 207
Store|null
getSession()
Get the session store instance.
at line 215
RedirectResponse
setSession(Store $session)
Set the session store instance.
at line 225
static void
flushState()
Flush all static state.