PHP Класс Irazasyed\JwtAuthGuard\JwtAuthGuard

Наследование: implements Illuminate\Contracts\Auth\Guard, use trait Illuminate\Auth\GuardHelpers
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$jwt Tymon\JWTAuth\JWT The JWT instance.
$lastAttempted Illuminate\Contracts\Auth\Authenticatable The user we last attempted to retrieve.
$request Illuminate\Http\Request The request instance.

Открытые методы

Метод Описание
__call ( string $method, array $parameters ) : mixed Magically call the JWT instance.
__construct ( Tymon\JWTAuth\JWT $jwt, Illuminate\Contracts\Auth\UserProvider $provider, Illuminate\Http\Request $request ) Create a new authentication guard.
attempt ( array $credentials = [], boolean $login = true ) : mixed Attempt to authenticate the user using the given credentials and return the token.
generateTokenById ( mixed $id ) : string | null Generate new token by ID.
getLastAttempted ( ) : Illuminate\Contracts\Auth\Authenticatable Get the last user we attempted to authenticate.
getPayload ( ) : Tymon\JWTAuth\Payload Get the raw Payload instance.
getProvider ( ) : Illuminate\Contracts\Auth\UserProvider Get the user provider used by the guard.
getToken ( ) : false | Token Get the token.
getUser ( ) : Illuminate\Contracts\Auth\Authenticatable | null Return the currently cached user.
invalidate ( boolean $forceForever = false ) : boolean Invalidate current token (add it to the blacklist).
login ( Tymon\JWTAuth\Contracts\JWTSubject $user ) : string Create a token for a user.
logout ( boolean $forceForever = true ) : boolean Logout the user.
once ( array $credentials = [] ) : boolean Log a user into the application without sessions or cookies.
onceUsingId ( mixed $id ) : boolean Log the given user ID into the application without sessions or cookies.
refresh ( ) : string Refresh current expired token.
setProvider ( Illuminate\Contracts\Auth\UserProvider $provider ) Set the user provider used by the guard.
setRequest ( Illuminate\Http\Request $request ) Set the current request instance.
setToken ( Token | string $token ) : JwtGuard Set the token.
user ( ) : Illuminate\Contracts\Auth\Authenticatable | null Get the currently authenticated user.
validate ( array $credentials = [] ) : boolean Validate a user's credentials.

Защищенные методы

Метод Описание
hasValidCredentials ( mixed $user, array $credentials ) : boolean Determine if the user matches the credentials.
requireToken ( ) : Tymon\JWTAuth\JWT Ensure that a token is available in the request.

Описание методов

__call() публичный Метод

Magically call the JWT instance.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

__construct() публичный Метод

Create a new authentication guard.
public __construct ( Tymon\JWTAuth\JWT $jwt, Illuminate\Contracts\Auth\UserProvider $provider, Illuminate\Http\Request $request )
$jwt Tymon\JWTAuth\JWT
$provider Illuminate\Contracts\Auth\UserProvider
$request Illuminate\Http\Request

attempt() публичный Метод

Attempt to authenticate the user using the given credentials and return the token.
public attempt ( array $credentials = [], boolean $login = true ) : mixed
$credentials array
$login boolean
Результат mixed

generateTokenById() публичный Метод

Generate new token by ID.
public generateTokenById ( mixed $id ) : string | null
$id mixed
Результат string | null

getLastAttempted() публичный Метод

Get the last user we attempted to authenticate.
public getLastAttempted ( ) : Illuminate\Contracts\Auth\Authenticatable
Результат Illuminate\Contracts\Auth\Authenticatable

getPayload() публичный Метод

Get the raw Payload instance.
public getPayload ( ) : Tymon\JWTAuth\Payload
Результат Tymon\JWTAuth\Payload

getProvider() публичный Метод

Get the user provider used by the guard.
public getProvider ( ) : Illuminate\Contracts\Auth\UserProvider
Результат Illuminate\Contracts\Auth\UserProvider

getToken() публичный Метод

Get the token.
public getToken ( ) : false | Token
Результат false | Token

getUser() публичный Метод

Return the currently cached user.
public getUser ( ) : Illuminate\Contracts\Auth\Authenticatable | null
Результат Illuminate\Contracts\Auth\Authenticatable | null

hasValidCredentials() защищенный Метод

Determine if the user matches the credentials.
protected hasValidCredentials ( mixed $user, array $credentials ) : boolean
$user mixed
$credentials array
Результат boolean

invalidate() публичный Метод

Invalidate current token (add it to the blacklist).
public invalidate ( boolean $forceForever = false ) : boolean
$forceForever boolean
Результат boolean

login() публичный Метод

Create a token for a user.
public login ( Tymon\JWTAuth\Contracts\JWTSubject $user ) : string
$user Tymon\JWTAuth\Contracts\JWTSubject
Результат string

logout() публичный Метод

Logout the user.
public logout ( boolean $forceForever = true ) : boolean
$forceForever boolean
Результат boolean

once() публичный Метод

Log a user into the application without sessions or cookies.
public once ( array $credentials = [] ) : boolean
$credentials array
Результат boolean

onceUsingId() публичный Метод

Log the given user ID into the application without sessions or cookies.
public onceUsingId ( mixed $id ) : boolean
$id mixed
Результат boolean

refresh() публичный Метод

Refresh current expired token.
public refresh ( ) : string
Результат string

requireToken() защищенный Метод

Ensure that a token is available in the request.
protected requireToken ( ) : Tymon\JWTAuth\JWT
Результат Tymon\JWTAuth\JWT

setProvider() публичный Метод

Set the user provider used by the guard.
public setProvider ( Illuminate\Contracts\Auth\UserProvider $provider )
$provider Illuminate\Contracts\Auth\UserProvider

setRequest() публичный Метод

Set the current request instance.
public setRequest ( Illuminate\Http\Request $request )
$request Illuminate\Http\Request

setToken() публичный Метод

Set the token.
public setToken ( Token | string $token ) : JwtGuard
$token Token | string
Результат JwtGuard

user() публичный Метод

Get the currently authenticated user.
public user ( ) : Illuminate\Contracts\Auth\Authenticatable | null
Результат Illuminate\Contracts\Auth\Authenticatable | null

validate() публичный Метод

Validate a user's credentials.
public validate ( array $credentials = [] ) : boolean
$credentials array
Результат boolean

Описание свойств

$jwt защищенное свойство

The JWT instance.
protected JWT,Tymon\JWTAuth $jwt
Результат Tymon\JWTAuth\JWT

$lastAttempted защищенное свойство

The user we last attempted to retrieve.
protected Authenticatable,Illuminate\Contracts\Auth $lastAttempted
Результат Illuminate\Contracts\Auth\Authenticatable

$request защищенное свойство

The request instance.
protected Request,Illuminate\Http $request
Результат Illuminate\Http\Request