Authenticate

class Authenticate (View source)

Properties

protected Factory $auth The authentication factory instance.

Methods

void __construct(Factory $auth)

Create a new middleware instance.

mixed handle(Request $request, Closure $next, string[] ...$guards)

Handle an incoming request.

void authenticate(Request $request, array $guards)

Determine if the user is logged in to any of the given guards.

void unauthenticated(Request $request, array $guards)

Handle an unauthenticated user.

string|null redirectTo(Request $request)

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

Details

void __construct(Factory $auth)

Create a new middleware instance.

Parameters

Factory $auth

Return Value

void

mixed handle(Request $request, Closure $next, string[] ...$guards)

Handle an incoming request.

Parameters

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

Return Value

mixed

Exceptions

AuthenticationException

protected void authenticate(Request $request, array $guards)

Determine if the user is logged in to any of the given guards.

Parameters

Request $request
array $guards

Return Value

void

Exceptions

AuthenticationException

protected void unauthenticated(Request $request, array $guards)

Handle an unauthenticated user.

Parameters

Request $request
array $guards

Return Value

void

Exceptions

AuthenticationException

protected string|null redirectTo(Request $request)

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

Parameters

Request $request

Return Value

string|null

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/6.x/Illuminate/Auth/Middleware/Authenticate.html