找不到 Laravel 5.4 类“App\Http\Controllers\Admin\Auth\Auth”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44575577/
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 16:08:53  来源:igfitidea点击:

Laravel 5.4 Class 'App\Http\Controllers\Admin\Auth\Auth' not found

phplaravel

提问by Damuluri Rohini Kumar

I've got this error while logging into the admin section. We have used the sample project from this url - https://github.com/jayminpanchal/laravel-multiauth-demo.

登录管理部分时出现此错误。我们使用了这个 url 中的示例项目 - https://github.com/jayminpanchal/laravel-multiauth-demo

This is the complete error got::

这是得到的完整错误::

Whoops, looks like something went wrong.

1/1
FatalErrorException in LoginController.php line 52:
Class 'App\Http\Controllers\Admin\Auth\Auth' not found
in LoginController.php line 52

回答by Ryan Kozak

This issuewas posted on the github repo you reference.

此问题已发布在您参考的 github 存储库上。

The solution posted by github user aliwesomeseemed to be that you must use Auth Facade in Admin\Auth\LoginController

github 用户aliwesome发布的解决方案似乎是您必须在 Admin\Auth\LoginController 中使用 Auth Facade

add this line :use Illuminate\Support\Facades\Auth;

添加这一行:使用 Illuminate\Support\Facades\Auth;