class AuthenticationRedirects

Single source of truth for boot-time auth redirect wiring.

Configures the worker-lifetime redirect callbacks on the auth/guest middleware and the authentication exception; it does not resolve or issue redirects at runtime.

Methods

static void
redirectGuestsTo(callable|string|null $redirect)

Configure where guests are redirected by the "auth" middleware.

static void
redirectUsersTo(callable|string $redirect)

Configure where users are redirected by the "guest" middleware.

static void
redirectTo(callable|string|null $guests = null, callable|string|null $users = null)

Configure where users are redirected by the authentication and guest middleware.

Details

at line 27
static void redirectGuestsTo(callable|string|null $redirect)

Configure where guests are redirected by the "auth" middleware.

Boot-only. The callback persists in authentication middleware and exception static properties for the worker lifetime and affects every subsequent unauthenticated or session-mismatch request.

Parameters

callable|string|null $redirect

Return Value

void

at line 43
static void redirectUsersTo(callable|string $redirect)

Configure where users are redirected by the "guest" middleware.

Boot-only. The callback persists in the guest middleware static property for the worker lifetime and affects every subsequent already-authenticated guest-route request.

Parameters

callable|string $redirect

Return Value

void

at line 55
static void redirectTo(callable|string|null $guests = null, callable|string|null $users = null)

Configure where users are redirected by the authentication and guest middleware.

Boot-only. The callbacks persist in authentication middleware and exception static properties for the worker lifetime and affect every subsequent matching request.

Parameters

callable|string|null $guests
callable|string|null $users

Return Value

void