PHP Класс JWTAuth, someline-starter

Наследование: extends Tymon\JWTAuth\Facades\JWTAuth
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
attempt ( array $credentials = [], array $customClaims = [] ) : false | string Attempt to authenticate the user and return the token.
authenticate ( mixed $token = false ) : mixed Authenticate a user via a token.
fromUser ( mixed $user, array $customClaims = [] ) : string Generate a token using the user identifier as the subject claim.
getIdentifier ( ) : string Get the identifier.
getPayload ( mixed $token = false ) : Tymon\JWTAuth\Payload Get the raw Payload instance.
getToken ( ) : boolean | string Get the token.
invalidate ( mixed $token = false ) : boolean Invalidate a token (add it to the blacklist).
manager ( ) : Tymon\JWTAuth\JWTManager Get the JWTManager instance.
parseToken ( $method = 'bearer', $header = 'authorization', string $query = 'token' ) : JWTAuth Parse the token from the request.
refresh ( mixed $token = false ) : string Refresh an expired token.
setIdentifier ( string $identifier ) Set the identifier.
setRequest ( Request $request ) Set the request instance.
setToken ( string $token ) Set the token.
toUser ( boolean | string $token = false ) : mixed Find a user using the user identifier in the subject claim.

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

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

Attempt to authenticate the user and return the token.
public static attempt ( array $credentials = [], array $customClaims = [] ) : false | string
$credentials array
$customClaims array
Результат false | string

authenticate() публичный статический Метод

Authenticate a user via a token.
public static authenticate ( mixed $token = false ) : mixed
$token mixed
Результат mixed

fromUser() публичный статический Метод

Generate a token using the user identifier as the subject claim.
public static fromUser ( mixed $user, array $customClaims = [] ) : string
$user mixed
$customClaims array
Результат string

getIdentifier() публичный статический Метод

Get the identifier.
public static getIdentifier ( ) : string
Результат string

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

Get the raw Payload instance.
public static getPayload ( mixed $token = false ) : Tymon\JWTAuth\Payload
$token mixed
Результат Tymon\JWTAuth\Payload

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

Get the token.
public static getToken ( ) : boolean | string
Результат boolean | string

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

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

manager() публичный статический Метод

Get the JWTManager instance.
public static manager ( ) : Tymon\JWTAuth\JWTManager
Результат Tymon\JWTAuth\JWTManager

parseToken() публичный статический Метод

Parse the token from the request.
public static parseToken ( $method = 'bearer', $header = 'authorization', string $query = 'token' ) : JWTAuth
$query string
Результат JWTAuth

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

Refresh an expired token.
public static refresh ( mixed $token = false ) : string
$token mixed
Результат string

setIdentifier() публичный статический Метод

Set the identifier.
public static setIdentifier ( string $identifier )
$identifier string

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

Set the request instance.
public static setRequest ( Request $request )
$request Request

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

Set the token.
public static setToken ( string $token )
$token string

toUser() публичный статический Метод

Find a user using the user identifier in the subject claim.
public static toUser ( boolean | string $token = false ) : mixed
$token boolean | string
Результат mixed