Redirector
class Redirector (View source)
Properties
| protected UrlGenerator | $generator | The URL generator instance. | |
| protected Store | $session | The session store instance. |
Methods
| void | __construct(UrlGenerator $generator) Create a new Redirector instance. | |
| RedirectResponse | home(int $status = 302) Create a new redirect response to the "home" route. | |
| RedirectResponse | back(int $status = 302, array $headers = [], string $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 $secure = null) Create a new redirect response, while putting the current URL in the session. | |
| RedirectResponse | intended(string $default = '/', int $status = 302, array $headers = [], bool $secure = null) Create a new redirect response to the previously intended location. | |
| RedirectResponse | to(string $path, int $status = 302, array $headers = [], bool $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, array $parameters = [], int $status = 302, array $headers = []) Create a new redirect response to a named route. | |
| RedirectResponse | action(string $action, array $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. |
Details
void __construct(UrlGenerator $generator)
Create a new Redirector instance.
RedirectResponse home(int $status = 302)
Create a new redirect response to the "home" route.
RedirectResponse back(int $status = 302, array $headers = [], string $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 $secure = null)
Create a new redirect response, while putting the current URL in the session.
RedirectResponse intended(string $default = '/', int $status = 302, array $headers = [], bool $secure = null)
Create a new redirect response to the previously intended location.
RedirectResponse to(string $path, int $status = 302, array $headers = [], bool $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, array $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a named route.
RedirectResponse action(string $action, array $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a controller action.
protected 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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Routing/Redirector.html