laravel 未定义身份验证保护驱动程序 [api]?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39409166/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 14:26:39  来源:igfitidea点击:

Auth guard driver [api] is not defined?

laravellaravel-5.2laravel-5.3

提问by Babaev

I use this library jwt-auth-guardin Laravel 5.3.

jwt-auth-guard在 Laravel 5.3 中使用了这个库。

When I try open page I get error:

当我尝试打开页面时,出现错误:

InvalidArgumentException in AuthManager.php line 99:
Auth guard driver [api] is not defined.

How can I fix it? I made everything that was need

我该如何解决?我做了所有需要的东西

采纳答案by AddWeb Solution Pvt Ltd

I'm not sure, please check you guard driver setup into config/auth.phpfirst. You can cross check this from GIT repo.

我不确定,请先检查您的保护驱动程序设置config/auth.php。你可以从GIT repo交叉检查这个。

Let me know if any concern from above.

如果上面有任何问题,请告诉我。

回答by Saeid Kanishka Saeidee

If you are using tymondesigns/jwt-auth package first check that you are downloading the latest version (1.0.0-rc.2 for this time) or you can just update your composer

如果您正在使用 tymondesigns/jwt-auth 包,请首先检查您是否正在下载最新版本(这次为 1.0.0-rc.2),或者您可以只更新您的作曲家

composer update 

and also delete your old jwt file from config folder and publish again also run!

并从 config 文件夹中删除旧的 jwt 文件并再次发布也运行!

php artisan jwt:secret