Documentation

StatefulGuard extends Guard

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

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

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
Return values
bool

Search results