TokenGuard
class TokenGuard implements Guard
Traits
These methods are typically the same across all guards.
Properties
protected Authenticatable | $user | The currently authenticated user. |
from GuardHelpers |
protected UserProvider | $provider | The user provider implementation. |
from GuardHelpers |
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. |
Methods
Get the currently authenticated user.
Get the token for the current request.
Validate a user's credentials.
Details
in
GuardHelpers at line 33
Authenticatable
authenticate()
Determine if the current user is authenticated.
in
GuardHelpers at line 47
bool
check()
Determine if the current user is authenticated.
in
GuardHelpers at line 57
bool
guest()
Determine if the current user is a guest.
in
GuardHelpers at line 67
int|null
id()
Get the ID for the currently authenticated user.
in
GuardHelpers at line 80
$this
setUser(Authenticatable $user)
Set the current user.
at line 41
void
__construct(UserProvider $provider, Request $request)
Create a new authentication guard.
at line 54
Authenticatable|null
user()
Get the currently authenticated user.
at line 81
string
getTokenForRequest()
Get the token for the current request.
at line 106
bool
validate(array $credentials = [])
Validate a user's credentials.
at line 127
$this
setRequest(Request $request)
Set the current request instance.