StatefulGuard
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 |
Authenticatable|null | user() Get the currently authenticated user. | from Guard |
int|null | id() Get the ID for the currently authenticated user. | from Guard |
bool | validate(array $credentials = []) Validate a user's credentials. | from Guard |
void | 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. | |
Authenticatable | loginUsingId(mixed $id, bool $remember = false) Log the given user ID into the application. | |
bool | 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.
bool guest()
Determine if the current user is a guest.
Authenticatable|null user()
Get the currently authenticated user.
int|null id()
Get the ID for the currently authenticated user.
bool validate(array $credentials = [])
Validate a user's credentials.
void setUser(Authenticatable $user)
Set the current user.
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.
Authenticatable loginUsingId(mixed $id, bool $remember = false)
Log the given user ID into the application.
bool 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.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Contracts/Auth/StatefulGuard.html