Documentation

TokenGuard
in package
implements Guard Uses GuardHelpers

Interfaces, Classes and Traits

Guard

Table of Contents

$inputKey  : string
The name of the query string item from the request containing the API token.
$provider  : UserProvider
The user provider implementation.
$request  : Request
The request instance.
$storageKey  : string
The name of the token "column" in persistent storage.
$user  : Authenticatable
The currently authenticated user.
__construct()  : void
Create a new authentication guard.
authenticate()  : Authenticatable
Determine if the current user is authenticated.
check()  : bool
Determine if the current user is authenticated.
getProvider()  : UserProvider
Get the user provider used by the guard.
getTokenForRequest()  : string
Get the token for the current request.
guest()  : bool
Determine if the current user is a guest.
id()  : int|null
Get the ID for the currently authenticated user.
setProvider()  : void
Set the user provider used by the guard.
setRequest()  : $this
Set the current request instance.
setUser()  : $this
Set the current user.
user()  : Authenticatable|null
Get the currently authenticated user.
validate()  : bool
Validate a user's credentials.

Properties

$inputKey

The name of the query string item from the request containing the API token.

protected string $inputKey

$storageKey

The name of the token "column" in persistent storage.

protected string $storageKey

Methods

check()

Determine if the current user is authenticated.

public check() : bool
Return values
bool

getTokenForRequest()

Get the token for the current request.

public getTokenForRequest() : string
Return values
string

guest()

Determine if the current user is a guest.

public guest() : bool
Return values
bool

id()

Get the ID for the currently authenticated user.

public id() : int|null
Return values
int|null

setRequest()

Set the current request instance.

public setRequest(Request $request) : $this
Parameters
$request : Request
Return values
$this

validate()

Validate a user's credentials.

public validate([array<string|int, mixed> $credentials = [] ]) : bool
Parameters
$credentials : array<string|int, mixed> = []
Return values
bool

Search results