Guard
in
Table of Contents
- 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.
- setUser() : void
- Set the current user.
- user() : Authenticatable|null
- Get the currently authenticated user.
- validate() : bool
- Validate a user's credentials.
Methods
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 —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> = []