bitmax / laravel-jwt
Laravel JWT LIB
dev-master
2023-03-05 15:04 UTC
Requires
- firebase/php-jwt: ^6.4
- illuminate/contracts: ^10.2
- illuminate/http: ^10.2
- illuminate/support: ^10.2
This package is auto-updated.
Last update: 2025-05-05 20:13:07 UTC
README
Simple JWT Auth that provide two routes /login
and /me
Configuration
Add a guard named api
with a driver api
to config/auth.php
.
Example:
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
"api" => [
'driver' => 'api'
]
...
],
Add the middleare auth:api
for routes you want to protect
Example:
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
License
The Laravel framework is open-sourced software licensed under the MIT license.