class Redirector (View source)
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected UrlGenerator | $generator | The URL generator instance. | |
| protected Store | $session | The session store instance. |
| 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(UrlGenerator $generator)
Create a new Redirector instance. | |
| RedirectResponse | back(int $status = 302, array $headers = [], mixed $fallback = false)
Create a new redirect response to the previous location. | |
| RedirectResponse | refresh(int $status = 302, array $headers = [])
Create a new redirect response to the current URI. | |
| RedirectResponse | guest(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
Create a new redirect response, while putting the current URL in the session. | |
| RedirectResponse | intended(mixed $default = '/', int $status = 302, array $headers = [], bool|null $secure = null)
Create a new redirect response to the previously intended location. | |
| RedirectResponse | to(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
Create a new redirect response to the given path. | |
| RedirectResponse | away(string $path, int $status = 302, array $headers = [])
Create a new redirect response to an external URL (no validation). | |
| RedirectResponse | secure(string $path, int $status = 302, array $headers = [])
Create a new redirect response to the given HTTPS path. | |
| RedirectResponse | route(string $route, mixed $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a named route. | |
| RedirectResponse | signedRoute(string $route, mixed $parameters = [], DateTimeInterface|DateInterval|int|null $expiration = null, int $status = 302, array $headers = [])
Create a new redirect response to a signed named route. | |
| RedirectResponse | temporarySignedRoute(string $route, DateTimeInterface|DateInterval|int|null $expiration, mixed $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a signed named route. | |
| RedirectResponse | action(string|array $action, mixed $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a controller action. | |
| RedirectResponse | createRedirect(string $path, int $status, array $headers)
Create a new redirect response. | |
| UrlGenerator | getUrlGenerator()
Get the URL generator instance. | |
| void | setSession(Store $session)
Set the active session store. | |
| string|null | getIntendedUrl()
Get the "intended" URL from the session. | |
| $this | setIntendedUrl(string $url)
Set the "intended" URL in the session. |
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 Redirector instance.
Create a new redirect response to the previous location.
Create a new redirect response to the current URI.
Create a new redirect response, while putting the current URL in the session.
Create a new redirect response to the previously intended location.
Create a new redirect response to the given path.
Create a new redirect response to an external URL (no validation).
Create a new redirect response to the given HTTPS path.
Create a new redirect response to a named route.
Create a new redirect response to a signed named route.
Create a new redirect response to a signed named route.
Create a new redirect response to a controller action.
Create a new redirect response.
Get the URL generator instance.
Set the active session store.
Get the "intended" URL from the session.
Set the "intended" URL in the session.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Routing/Redirector.html