Download the PHP package lgrevelink/laravel-simple-jwt without Composer
On this page you can find all versions of the php package lgrevelink/laravel-simple-jwt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lgrevelink/laravel-simple-jwt
More information about lgrevelink/laravel-simple-jwt
Files in lgrevelink/laravel-simple-jwt
Package laravel-simple-jwt
Short Description Utilties for using the php-simple-jwt package in Laravel/Lumen projects.
License MIT
Informations about the package laravel-simple-jwt
Laravel Simple JWT
Laravel and Lumen utilities to kickstart the usage of the PHP Simple JWT package.
Supported functionalities;
- Artisan make command for JWT Blueprints (
make:jwt-blueprint
) - Validator rule for JWT validation
Installation
For Laravel
Laravel's auto-discovery directly registers the service provider so it should be instantly usable. If you don't use auto-discovery, please add the SimpleJwtServiceProvider
to the provider array in config/app.php
.
Both the artisan command and the validator are directly registered by adding the service provider.
For Lumen
Using this package in lumen requires you to register the service provider in bootstrap/app.php
.
Auto-extending the validator rule only works when the Facades have been setup. This can be done by enabling the withFacades
option in bootstrap/app.php
. Aliases are not necessary.
Usage
Generator command
After getting set up, generating your first Blueprint is very easy.
A series of questions are following setting up the default claims supported by JWT. Values you don't want to use can be left empty and won't be added. The default namespace where the blueprints will be placed is App\JwtTokens
.
All date-related claims (e.g. expiration time) are treated as relative values from the moment generation. Find more information about the Simple JWT package and its usage here.
Validator
There are 2 general ways of using the validator rule.
Basic usage
This only validates whether the token has a valid JWT structure.
Blueprint usage
This validates the token directly against the given blueprint.
Tests
Tests are written with PHPUnit and can be run via the following composer command;
All versions of laravel-simple-jwt with dependencies
illuminate/console Version >=5.7
illuminate/support Version >=5.7
illuminate/validation Version >=5.7
lgrevelink/php-simple-jwt Version ^0.2