class AuthenticateSession implements AuthenticatesSessions (View source)

Properties

protected Factory $auth

The authentication factory implementation.

static protected callable $redirectToCallback

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

Methods

void
__construct(Factory $auth)

Create a new middleware instance.

mixed
handle(Request $request, Closure $next)

Handle an incoming request.

void
storePasswordHashInSession(Request $request)

Store the user's current password hash in the session.

void
logout(Request $request)

Log the user out of the application.

guard()

Get the guard instance that should be used by the middleware.

string|null
redirectTo(Request $request)

Get the path the user should be redirected to when their session is not authenticated.

static void
redirectUsing(callable $redirectToCallback)

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

Details

void __construct(Factory $auth)

Create a new middleware instance.

Parameters

Factory $auth

Return Value

void

mixed handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

mixed

protected void storePasswordHashInSession(Request $request)

Store the user's current password hash in the session.

Parameters

Request $request

Return Value

void

protected void logout(Request $request)

Log the user out of the application.

Parameters

Request $request

Return Value

void

Exceptions

AuthenticationException

protected Factory|Guard guard()

Get the guard instance that should be used by the middleware.

Return Value

Factory|Guard

protected string|null redirectTo(Request $request)

Get the path the user should be redirected to when their session is not authenticated.

Parameters

Request $request

Return Value

string|null

static void redirectUsing(callable $redirectToCallback)

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

Parameters

callable $redirectToCallback

Return Value

void

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.