我收到错误类'Tymon \ JWTAuth \ Providers \ JWTAuthServiceProvider'

我正在安装jwt-auth软件包。我运行此命令

composer require tymon/jwt-auth

有composer.json文件

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^2.0",
        "tymon/jwt-auth": "^1.0"
    },

并且有app.php文件

  'providers' => [
              ........
        Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,

    ],
   'aliases' => [
              ........
        'JWTAuth' =>Tymon\JWTAuth\Facades\JWTAuth::class,
        'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class,
    ],

我什么时候运行此命令。

php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\JWTAuthServiceProvider"

遇到错误。

In ProviderRepository.php line 208:

  Class 'Tymon\JWTAuth\Providers\JWTAuthServiceProvider' not found  
评论
ksequi
ksequi

您可能正在阅读旧文档或正在观看一些旧版本的教程视频。

它应该是:

php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"

Docs: https://jwt-auth.readthedocs.io/en/develop/laravel-installation/

点赞
评论