Laravel | PHP |
---|---|
5.0.x | >= 5.4 |
5.1.x | >= 5.5.9 |
Add the following line to your composer.json
file:
"lucasandrade/laravel-jwtauth": "dev-master"
Then run composer update
to get the package.
Add this line of code to the providers
array located in your config/app.php
file:
Lucandrade\JwtAuth\JwtAuthServiceProvider::class,
Add this line to the aliases
array:
'JwtAuth' => \Lucandrade\JwtAuth\Facades\JwtAuth::class,
Run the vendor:publish
command:
php artisan vendor:publish
Execute this command from your project path:
mkdir config & cp ./vendor/lucasandrade/laravel-jwtauth/config/jwtauth.php ./config & cp ./vendor/lucasandrade/laravel-jwtauth/database/migrations/* ./database/migrations/
Uncomment the following line of your bootstrap/app.php
file:
\\ $app->withFacades();
Add this line in the end of file:
$app->register(Lucandrade\JwtAuth\Lumen\JwtAuthServiceProvider::class);
Then run migrate
command:
php artisan migrate
Soon
Note: remember to add
use JwtAuth;
to the beginning of the yours class file