RedirectResponse
class RedirectResponse extends RedirectResponse implements Responsable
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.
Expire multiple cookies 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.
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 184
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
withCookies(array $cookies)
Add multiple cookies to the response.
in
ResponseTrait at line 146
ResponseTrait
withoutCookie(mixed $cookie, string|null $path = null, string|null $domain = null)
Expire a cookie when sending the response.
in
ResponseTrait at line 162
ResponseTrait
withoutCookies(array $cookies, string|null $path = null, string|null $domain = null)
Expire multiple cookies when sending the response.
in
ResponseTrait at line 174
string|null
getCallback()
Get the callback of the response.
in
ResponseTrait at line 184
ResponseTrait
withException(Throwable $e)
Set the exception to attach to the response.
in
ResponseTrait at line 196
never
throwResponse()
Throw the response in a HttpResponseException instance.
in
Macroable at line 30
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 44
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 61
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 72
static void
flushMacros()
Flush the existing macros.
Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 83
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 253
mixed
__call(string $method, array $parameters)
Dynamically bind flash data in the session.
at line 42
RedirectResponse
with(string|array $key, mixed $value = null)
Flash a piece of data to the session.
at line 58
RedirectResponse
withInput(array|null $input = null)
Flash an array of input to the session.
at line 70
protected array
removeFilesFromInput(array $input)
Remove all uploaded files from the given input array.
at line 90
RedirectResponse
onlyInput()
Flash only the specified input keys to the session.
at line 100
RedirectResponse
exceptInput()
Flash all input except the specified keys to the session.
at line 110
RedirectResponse
withErrors(MessageProvider|array|string $provider, string $key = 'default')
Flash a container of errors to the session.
at line 131
protected MessageBag
parseErrors(MessageProvider|array|string $provider)
Parse the given errors into an appropriate value.
at line 145
RedirectResponse
withFragment(string $fragment)
Add a fragment identifier to the URL.
at line 156
RedirectResponse
withoutFragment()
Remove any fragment identifier from the response URL.
at line 164
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 192
Request|null
getRequest()
Get the request instance.
at line 202
RedirectResponse
setRequest(Request $request)
Set the request instance.
at line 212
Store|null
getSession()
Get the session store instance.
at line 222
RedirectResponse
setSession(Store $session)
Set the session store instance.
at line 235
Response
toResponse(Request $request)
Create an HTTP response that represents the object.
at line 243
static void
flushState()
Flush all static state.