Guard
interface Guard (View source)
Methods
Determine if the current user is authenticated.
Determine if the current user is a guest.
Get the currently authenticated user.
Get the ID for the currently authenticated user.
Validate a user's credentials.
Determine if the guard has a user instance.
Details
bool
check()
Determine if the current user is authenticated.
bool
guest()
Determine if the current user is a guest.
Authenticatable|null
user()
Get the currently authenticated user.
int|string|null
id()
Get the ID for the currently authenticated user.
bool
validate(array $credentials = [])
Validate a user's credentials.
bool
hasUser()
Determine if the guard has a user instance.
$this
setUser(Authenticatable $user)
Set the current user.
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.