mideal / laravel-jwt
There is no license information available for the latest version (1.0.1) of this package.
Jwt auth for laravel
1.0.1
2023-04-05 22:19 UTC
Requires
- php: ^8.0.2
- firebase/php-jwt: ^6.4
- illuminate/auth: ^10.0
- illuminate/config: ^10.0
- illuminate/contracts: ^10.0
- illuminate/http: ^10.0
- illuminate/support: ^10.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- mockery/mockery: ^1.5
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
README
Laravel Jwt provides a authentication system with jwt for SPAs and API.
Installation
You may install Laravel Jwt via the Composer package manager:
composer require mideal/laravel-jwt
Next, you should publish the Jwt configuration files using the vendor:publish Artisan command. The jwt configuration file will be placed in your application's config directory:
php artisan vendor:publish --provider="Mideal\Jwt\JwtServiceProvider"
Protecting Routes
use Illuminate\Http\Request; Route::middleware('auth:jwt')->get('/user', function (Request $request) { return $request->user(); });