interface StatefulGuard implements Guard (View source)

Methods

bool
check()

Determine if the current user is authenticated.

from  Guard
bool
guest()

Determine if the current user is a guest.

from  Guard
user()

Get the currently authenticated user.

from  Guard
int|string|null
id()

Get the ID for the currently authenticated user.

from  Guard
bool
validate(array $credentials = [])

Validate a user's credentials.

from  Guard
bool
hasUser()

Determine if the guard has a user instance.

from  Guard
$this
setUser(Authenticatable $user)

Set the current user.

from  Guard
bool
attempt(array $credentials = [], bool $remember = false)

Attempt to authenticate a user using the given credentials.

bool
once(array $credentials = [])

Log a user into the application without sessions or cookies.

void
login(Authenticatable $user, bool $remember = false)

Log a user into the application.

loginUsingId(mixed $id, bool $remember = false)

Log the given user ID into the application.

onceUsingId(mixed $id)

Log the given user ID into the application without sessions or cookies.

bool
viaRemember()

Determine if the user was authenticated via "remember me" cookie.

void
logout()

Log the user out of the application.

Details

bool check()

Determine if the current user is authenticated.

Return Value

bool

bool guest()

Determine if the current user is a guest.

Return Value

bool

Authenticatable|null user()

Get the currently authenticated user.

Return Value

Authenticatable|null

int|string|null id()

Get the ID for the currently authenticated user.

Return Value

int|string|null

bool validate(array $credentials = [])

Validate a user's credentials.

Parameters

array $credentials

Return Value

bool

bool hasUser()

Determine if the guard has a user instance.

Return Value

bool

$this setUser(Authenticatable $user)

Set the current user.

Parameters

Authenticatable $user

Return Value

$this

bool attempt(array $credentials = [], bool $remember = false)

Attempt to authenticate a user using the given credentials.

Parameters

array $credentials
bool $remember

Return Value

bool

bool once(array $credentials = [])

Log a user into the application without sessions or cookies.

Parameters

array $credentials

Return Value

bool

void login(Authenticatable $user, bool $remember = false)

Log a user into the application.

Parameters

Authenticatable $user
bool $remember

Return Value

void

Authenticatable|false loginUsingId(mixed $id, bool $remember = false)

Log the given user ID into the application.

Parameters

mixed $id
bool $remember

Return Value

Authenticatable|false

Authenticatable|false onceUsingId(mixed $id)

Log the given user ID into the application without sessions or cookies.

Parameters

mixed $id

Return Value

Authenticatable|false

bool viaRemember()

Determine if the user was authenticated via "remember me" cookie.

Return Value

bool

void logout()

Log the user out of the application.

Return Value

void