class TokenGuard implements Guard (View source)
| GuardHelpers | These methods are typically the same across all guards. |
| Macroable |
| protected Authenticatable|null | $user | The currently authenticated user. | from GuardHelpers |
| protected UserProvider | $provider | The user provider implementation. | from GuardHelpers |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected Request | $request | The request instance. | |
| protected string | $inputKey | The name of the query string item from the request containing the API token. | |
| protected string | $storageKey | The name of the token "column" in persistent storage. | |
| protected bool | $hash | Indicates if the API token is hashed in storage. |
| Authenticatable | authenticate()
Determine if the current user is authenticated. If not, throw an exception. | from GuardHelpers |
| bool | hasUser()
Determine if the guard has a user instance. | from GuardHelpers |
| bool | check()
Determine if the current user is authenticated. | from GuardHelpers |
| bool | guest()
Determine if the current user is a guest. | from GuardHelpers |
| int|string|null | id()
Get the ID for the currently authenticated user. | from GuardHelpers |
| $this | setUser(Authenticatable $user)
Set the current user. | from GuardHelpers |
| $this | forgetUser()
Forget the current user. | from GuardHelpers |
| UserProvider | getProvider()
Get the user provider used by the guard. | from GuardHelpers |
| void | setProvider(UserProvider $provider)
Set the user provider used by the guard. | from GuardHelpers |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| void | __construct(UserProvider $provider, Request $request, string $inputKey = 'api_token', string $storageKey = 'api_token', bool $hash = false)
Create a new authentication guard. | |
| Authenticatable|null | user()
Get the currently authenticated user. | |
| string|null | getTokenForRequest()
Get the token for the current request. | |
| bool | validate(array $credentials = [])
Validate a user's credentials. | |
| $this | setRequest(Request $request)
Set the current request instance. |
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.
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new authentication guard.
Get the currently authenticated user.
Get the token for the current request.
Validate a user's credentials.
Set the current request instance.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Auth/TokenGuard.html