本文介绍了我遇到错误---在ProviderRepository.php第208行:未找到类'Tymon \ JWTAuth \ Providers \ LaravelServiceProvider'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是laravel的新手,这是我的第一个问题,因为我在任何地方都找不到解决方案.我以某种方式实现了JWT令牌,并且一直有效,直到弄乱了它.现在,当我输入php artisan serve时,会收到该错误,或​​者尝试发布时.我尝试了所有有问题的东西--- Laravel 5.6.26错误-未找到类'Tymon \ JWTAuth \ Providers \ LaravelServiceProvider' ---但无法正常工作.当我在composer.json中添加"tymon/jwt-auth":"^ 0.5.12"时,我得到一个错误类LaravelServiceProvider,并且将其更改为"tymon/jwt-auth":"^ 1.0.0- beta.3"或"tymon/jwt-auth":"^ 1.0.0-rc.2",则找不到错误JWTAuthServiceProvider.我也尝试过作曲家需要光照/认证,但无法正常工作.我可以帮忙吗?

I'am new to laravel, and this is my first question because I could not find a solution anywhere. I implemented JWT-token somehow and it worked until I mess it up. Now when I type php artisan serve I get that error, or when I try to publish. I tried everything like in question --- Laravel 5.6.26 Error- Class 'Tymon\JWTAuth\Providers\LaravelServiceProvider' not found --- but it won't work.When I add in composer.json "tymon/jwt-auth": "^0.5.12" I get an error class LaravelServiceProvider not found, and when I change it to "tymon/jwt-auth": "^1.0.0-beta.3" or "tymon/jwt-auth": "^1.0.0-rc.2" then I ger error JWTAuthServiceProvider not found. I also tried composer require illuminate/auth but it won't work. Can I get some help please.

推荐答案

我遇到了同样的问题,我通过执行以下命令解决了该问题

I had this same issue and I solved it by executing these commands

composer require illuminate/auth

composer require tymon/jwt-auth:"^1.0.0-rc.2"

composer update

然后

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

您可以安全地从app.php文件中删除

You can safely remove from your app.php file

Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,

'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class,
'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class

这篇关于我遇到错误---在ProviderRepository.php第208行:未找到类'Tymon \ JWTAuth \ Providers \ LaravelServiceProvider'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 22:32