承接 nobelatunje/jwt 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

nobelatunje/jwt

最新稳定版本:1.0.0

Composer 安装命令:

composer require nobelatunje/jwt

包简介

JWT Package for Laravel and Lumen

README 文档

README

A simple JSON Web Token Authentication Library built on top of lcobucci/jwt for Laravel and Lumen.

It uses Asymmetric Algorithm using a private key for signature creation and a public key for verification. This means that it's fine to distribute your public key. However, the private key should remain secret.

Laravel Installation

Via composer

composer require nobelatunje/jwt

Install the package

php artisan jwt:install

Generate private and public keys

php artisan jwt:generate

Modify the jwtconfig.php in your config file as necessary and add your app's Policies if necessary.

Change the route driver in your auth.php config file to jwt.

'guards' => [
    'custom_guard' => [
        'driver' => 'jwt',
        'provider' => 'users',
    ],
],

Auth Guard Usage

Routing

Route::middleware('auth:custom_guard')->get('/user', function (Request $request) {
    return $request->user();
});

//if you set jwt as driver for your api guard
Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Login

// Generate a token for the user if the credentials are valid
$token = Auth::attempt($credentials);

User

// Get the currently authenticated user
$user = Auth::user();

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固