dsgdhf5674 2015-12-26 18:46
浏览 60
已采纳

Laravel命名空间和身份验证

I'm working with a Laravel 5.2 test site, and I'm using the built-in auth system to handle logins.

I changed the name of the app namespace to myTest using php artisan app:name myTest

However, when I submit the login form I'm still getting an error due to a namespace issue in the auth system:

FatalErrorException in EloquentUserProvider.php line 126:
Class '\App\User' not found

Is there somewhere I need to edit the namespace so that this will work?

EDIT: PSR4 block of composer.json is:

"psr-4": {
    "myTest\\": "app/"
}

Yes, I did already composer dump-autoload to try to refresh the namespacing, and the same issue appears.

  • 写回答

1条回答 默认 最新

  • doulianxing4015 2015-12-26 23:42
    关注

    You need to update your config/auth.php file.

    Check under providers -> users -> model.

    Adjust that from App\User::class to your class.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)