vkoori/laravel-jwt 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-07-18