class Illuminate / Auth / TokenGuard
You are viewing an older version of the documentation. For the latest, please visit master documentation.

TokenGuard

Implements

Uses

Properties

protected

$request Request

The request instance.

Default: null
protected

$inputKey string

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

Default: null
protected

$storageKey string

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

Default: null
protected

$hash bool

Indicates if the API token is hashed in storage.

Default: false

Methods

public

__construct ( UserProvider $provider , Request $request , $inputKey , $storageKey , $hash ) : void

Create a new authentication guard.

Parameters

public

user ( ) : Authenticatable |null

Get the currently authenticated user.

public

getTokenForRequest ( ) : string

Get the token for the current request.

public

validate ( array $credentials ) : bool

Validate a user's credentials.

Parameters

  • $credentials array
public

setRequest ( Request $request ) : $this

Set the current request instance.

Parameters