bitmax/laravel-jwt

Laravel JWT LIB

dev-master 2023-03-05 15:04 UTC

This package is auto-updated.

Last update: 2024-05-05 17:38:54 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.