StatefulGuard
extends
Guard
in
Table of Contents
- attempt() : bool
- Attempt to authenticate a user using the given credentials.
- check() : bool
- Determine if the current user is authenticated.
- guest() : bool
- Determine if the current user is a guest.
- id() : int|null
- Get the ID for the currently authenticated user.
- login() : void
- Log a user into the application.
- loginUsingId() : Authenticatable
- Log the given user ID into the application.
- logout() : void
- Log the user out of the application.
- once() : bool
- Log a user into the application without sessions or cookies.
- onceUsingId() : bool
- Log the given user ID into the application without sessions or cookies.
- setUser() : void
- Set the current user.
- user() : Authenticatable|null
- Get the currently authenticated user.
- validate() : bool
- Validate a user's credentials.
- viaRemember() : bool
- Determine if the user was authenticated via "remember me" cookie.
Methods
attempt()
Attempt to authenticate a user using the given credentials.
public
attempt([array<string|int, mixed> $credentials = [] ][, bool $remember = false ]) : bool
Parameters
- $credentials : array<string|int, mixed> = []
- $remember : bool = false
Return values
bool —check()
Determine if the current user is authenticated.
public
check() : bool
Return values
bool —guest()
Determine if the current user is a guest.
public
guest() : bool
Return values
bool —id()
Get the ID for the currently authenticated user.
public
id() : int|null
Return values
int|null —login()
Log a user into the application.
public
login(Authenticatable $user[, bool $remember = false ]) : void
Parameters
- $user : Authenticatable
- $remember : bool = false
Return values
void —loginUsingId()
Log the given user ID into the application.
public
loginUsingId(mixed $id[, bool $remember = false ]) : Authenticatable
Parameters
- $id : mixed
- $remember : bool = false
Return values
Authenticatable —logout()
Log the user out of the application.
public
logout() : void
Return values
void —once()
Log a user into the application without sessions or cookies.
public
once([array<string|int, mixed> $credentials = [] ]) : bool
Parameters
- $credentials : array<string|int, mixed> = []
Return values
bool —onceUsingId()
Log the given user ID into the application without sessions or cookies.
public
onceUsingId(mixed $id) : bool
Parameters
- $id : mixed
Return values
bool —setUser()
Set the current user.
public
setUser(Authenticatable $user) : void
Parameters
- $user : Authenticatable
Return values
void —user()
Get the currently authenticated user.
public
user() : Authenticatable|null
Return values
Authenticatable|null —validate()
Validate a user's credentials.
public
validate([array<string|int, mixed> $credentials = [] ]) : bool
Parameters
- $credentials : array<string|int, mixed> = []
Return values
bool —viaRemember()
Determine if the user was authenticated via "remember me" cookie.
public
viaRemember() : bool