class RedirectIfAuthenticated

Properties

static protected null|callable $redirectToCallback

The callback that should be used to generate the authentication redirect path.

Methods

static string
using(string $guard, string ...$others)

Specify the guards for the middleware.

Response
handle(Request $request, Closure $next, string ...$guards)

Handle an incoming request.

string|null
redirectTo(Request $request)

Get the path the user should be redirected to when they are authenticated.

string
defaultRedirectUri()

Get the default URI the user should be redirected to when they are authenticated.

static void
redirectUsing(callable $redirectToCallback)

Specify the callback that should be used to generate the redirect path.

static void
flushState()

Flush all static state.

Details

at line 25
static string using(string $guard, string ...$others)

Specify the guards for the middleware.

Parameters

string $guard
string ...$others

Return Value

string

at line 33
Response handle(Request $request, Closure $next, string ...$guards)

Handle an incoming request.

Parameters

Request $request
Closure $next
string ...$guards

Return Value

Response

at line 55
protected string|null redirectTo(Request $request)

Get the path the user should be redirected to when they are authenticated.

Parameters

Request $request

Return Value

string|null

at line 65
protected string defaultRedirectUri()

Get the default URI the user should be redirected to when they are authenticated.

Return Value

string

at line 91
static void redirectUsing(callable $redirectToCallback)

Specify the callback that should be used to generate the redirect path.

Boot-only. The callback persists in a static property for the worker lifetime and runs on every already-authenticated request handled by this middleware.

Parameters

callable $redirectToCallback

Return Value

void

at line 99
static void flushState()

Flush all static state.

Return Value

void