Package Data | |
---|---|
Maintainer Username: | ngabor84 |
Maintainer Contact: | negabor@gmail.com (Gabor Nemeth) |
Package Create Date: | 2018-11-26 |
Package Last Update: | 2024-10-04 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-23 03:16:00 |
Package Statistics | |
---|---|
Total Downloads: | 3,278 |
Monthly Downloads: | 15 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 2 |
Total Open Issues: | 0 |
JWT authentication middleware for the Laravel and Lumen framework.
This package allows you to authenticate the incoming requests with JWT authentication.
Require the ngabor84/laravel-jwt-auth package in your composer.json and update your dependencies:
composer require ngabor84/laravel-jwt-auth
Add the service provider to the providers array in the config/app.php config file as follows:
'providers' => [
...
\Middleware\Auth\Jwt\Providers\LaravelServiceProvider::class,
]
Run the following command to publish the package config file:
php artisan vendor:publish --provider="Middleware\Auth\Jwt\Providers\LaravelServiceProvider"
You should now have a config/jwt.php file that allows you to configure the basics of this package.
Add the following snippet to the bootstrap/app.php file under the providers section as follows:
$app->register(\Middleware\Auth\Jwt\Providers\LumenServiceProvider::class);
...
$app->configure('jwt');
Create a config directory (if it's not exist), and create an jwt.php in it with the plugin configuration like this:
return [
'secret' => env('JWT_SECRET'),
'algo' => 'HS256',
'expiration' => 10, // 10 minutes
];