PHP Trait GenTux\Jwt\GetsJwtToken

Mostra file Open project: generationtux/jwt-artisan

Public Methods

Method Description
getToken ( Illuminate\Http\Request | null $request = null ) : string | null Get the JWT token from the request
jwtPayload ( string | null $path = null, Illuminate\Http\Request | null $request = null ) : array Get payload from JWT token
jwtToken ( Illuminate\Http\Request | null $request = null ) : JwtToken Create a new JWT token object from the token in the request

Private Methods

Method Description
getAuthHeaderKey ( ) : string Get the header key to search for the token
getInputName ( ) : string Get the input name to search for the token in the request
makeDriver ( ) : GenTux\Jwt\Drivers\JwtDriverInterface Create a driver to use for the token from the IoC
makeRequest ( ) : Illuminate\Http\Request Resolve the current request from the IoC

Method Details

getToken() public method

We'll check the Authorization header first, and if that's not set then check the input to see if its provided there instead.
public getToken ( Illuminate\Http\Request | null $request = null ) : string | null
$request Illuminate\Http\Request | null
return string | null

jwtPayload() public method

Get payload from JWT token
public jwtPayload ( string | null $path = null, Illuminate\Http\Request | null $request = null ) : array
$path string | null to query payload
$request Illuminate\Http\Request | null
return array

jwtToken() public method

Create a new JWT token object from the token in the request
public jwtToken ( Illuminate\Http\Request | null $request = null ) : JwtToken
$request Illuminate\Http\Request | null
return JwtToken