Download the PHP package tungltdev/laravel-php-jwt without Composer
On this page you can find all versions of the php package tungltdev/laravel-php-jwt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tungltdev/laravel-php-jwt
More information about tungltdev/laravel-php-jwt
Files in tungltdev/laravel-php-jwt
Package laravel-php-jwt
Short Description A simple library to encode and decode JSON Web Tokens (JWT) in PHP.
License MIT
Homepage https://github.com/tungltdev/laravel-php-jwt
Informations about the package laravel-php-jwt
Installation
Use composer to manage your dependencies and download LARAVEL-JWT:
config key in file config/jwt.php
add Middleware to api
protected $routeMiddleware = [ ... 'jwt.auth' => \App\Http\Middleware\VerifyJWTToken::class, ...
api.php add line:
Route::group(['middleware' => 'jwt.auth'], function () { Route::post('/address_member', 'AddressMemberController@store'); });
get info user jwt: $request->jwtUser
dd($request->jwtUser); Example
Support for reserved claim names JSON Web Token defines some reserved claim names and defines how they should be used. JWT supports these reserved claim names:
'exp' (Expiration Time) Claim
'nbf' (Not Before Time) Claim
'iss' (Issuer) Claim
'iat' (Issued At) Claim
Expiration Time Claim The exp (expiration time) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. The processing of the exp claim requires that the current date/time MUST be before the expiration date/time listed in the exp claim. Implementers MAY provide for some small leeway, usually no more than a few minutes, to account for clock skew. Its value MUST be a number containing a NumericDate value. Use of this claim is OPTIONAL.
Not Before Time Claim The nbf (not before) claim identifies the time before which the JWT MUST NOT be accepted for processing. The processing of the nbf claim requires that the current date/time MUST be after or equal to the not-before date/time listed in the nbf claim. Implementers MAY provide for some small leeway, usually no more than a few minutes, to account for clock skew. Its value MUST be a number containing a NumericDate value. Use of this claim is OPTIONAL
Issuer Claim The iss (issuer) claim identifies the principal that issued the JWT. The processing of this claim is generally application specific. The iss value is a case-sensitive string containing a StringOrURI value. Use of this claim is OPTIONAL.
Issued At Claim The iat (issued at) claim identifies the time at which the JWT was issued. This claim can be used to determine the age of the JWT. Its value MUST be a number containing a NumericDate value. Use of this claim is OPTIONAL.