vkoori/laravel-jwt
最新稳定版本:0.1.1
Composer 安装命令:
composer require vkoori/laravel-jwt
包简介
Integration of firebase/php-jwt library for laravel.
关键字:
README 文档
README
This package provides a simple way to integrate JWT (JSON Web Tokens) for authentication in your Laravel application using the firebase/php-jwt library.
Installation
To install the package, run the following command:
composer require vkoori/laravel-jwt
Once the package is installed, you need to publish the provider using the following Artisan command:
php artisan vendor:publish --provider="Vkoori\LaravelJwt\JwtServiceProvider"
This will publish the config/jwt-config.php configuration file where you can manage the JWT settings.
Usage
Generating JWT Token
You can generate a JWT token by calling the service as follows:
\Vkoori\LaravelJwt\Services\Jwt::sign() ->setAudience($audience) ->setSubject($this->getAuthIdentifier()) ->setScopes($scopes) ->setExpirationTime(Carbon::now()->addSeconds($ttl)) ->encode();
Verifying JWT Token
To verify and decode the JWT token, you can use the following code:
Jwt::verify(token: $token);
统计信息
- 总下载量: 443
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-07-18