Guard
interface Guard (View source)
Methods
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. | |
bool | once(array $credentials = []) Log a user into the application without sessions or cookies. | |
bool | attempt(array $credentials = [], bool $remember = false, bool $login = true) Attempt to authenticate a user using the given credentials. | |
Response|null | basic(string $field = 'email') Attempt to authenticate using HTTP Basic Auth. | |
Response|null | onceBasic(string $field = 'email') Perform a stateless HTTP Basic login attempt. | |
bool | validate(array $credentials = []) Validate a user's credentials. | |
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 | 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.
bool once(array $credentials = [])
Log a user into the application without sessions or cookies.
bool attempt(array $credentials = [], bool $remember = false, bool $login = true)
Attempt to authenticate a user using the given credentials.
Response|null basic(string $field = 'email')
Attempt to authenticate using HTTP Basic Auth.
Response|null onceBasic(string $field = 'email')
Perform a stateless HTTP Basic login attempt.
bool validate(array $credentials = [])
Validate a user's credentials.
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 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.1/Illuminate/Contracts/Auth/Guard.html