class AuthenticationException extends Exception

Properties

protected array $guards

All of the guards that were checked.

protected string|null $redirectTo

The path the user should be redirected to.

static protected null|callable $redirectToCallback

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

Methods

__construct(string $message = 'Unauthenticated.', array $guards = [], string|null $redirectTo = null)

Create a new authentication exception.

array
guards()

Get the guards that were checked.

string|null
redirectTo(Request $request)

Get the path the user should be redirected to.

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 32
__construct(string $message = 'Unauthenticated.', array $guards = [], string|null $redirectTo = null)

Create a new authentication exception.

Parameters

string $message
array $guards
string|null $redirectTo

at line 43
array guards()

Get the guards that were checked.

Return Value

array

at line 51
string|null redirectTo(Request $request)

Get the path the user should be redirected to.

Parameters

Request $request

Return Value

string|null

at line 70
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 unauthenticated exception.

Parameters

callable $redirectToCallback

Return Value

void

at line 78
static void flushState()

Flush all static state.

Return Value

void