trait GuardHelpers (View source)
These methods are typically the same across all guards.
| protected Authenticatable|null | $user | The currently authenticated user. | |
| protected UserProvider | $provider | The user provider implementation. |
| Authenticatable | authenticate()
Determine if the current user is authenticated. If not, throw an exception. | |
| bool | hasUser()
Determine if the guard has a user instance. | |
| bool | check()
Determine if the current user is authenticated. | |
| bool | guest()
Determine if the current user is a guest. | |
| int|string|null | id()
Get the ID for the currently authenticated user. | |
| $this | setUser(Authenticatable $user)
Set the current user. | |
| $this | forgetUser()
Forget the current user. | |
| UserProvider | getProvider()
Get the user provider used by the guard. | |
| void | setProvider(UserProvider $provider)
Set the user provider used by the guard. |
Determine if the current user is authenticated. If not, throw an exception.
Determine if the guard has a user instance.
Determine if the current user is authenticated.
Determine if the current user is a guest.
Get the ID for the currently authenticated user.
Set the current user.
Forget the current user.
Get the user provider used by the guard.
Set the user provider used by the guard.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Auth/GuardHelpers.html