dongluanjie8678
2017-03-01 16:13
浏览 69
已采纳

什么是Laravel Auth类将其链接到控制器

What is the class Path for Laravel Auth Class I want it on my Home Controller

FatalErrorException in HomeController.php line 29: Class 
'App\Http\Controllers\Auth' not found

图片转代码服务由CSDN问答提供 功能建议

Laravel Auth Class的类路径我希望它在我的Home Controller上 HomeController.php第29行中的

  FatalErrorException:未找到类
'App \ Http \ Controllers \ Auth'
   
 
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duan20081202 2017-03-01 16:17
    已采纳

    I supose you are using the Auth class in your php files. You should place a \ in front of the class name to let the parse know this is in the root namespace.

    For example, like this:

    \Auth::check();
    

    Alternatively, you can add the following line on top of your class:

    use Auth;
    

    This will let the parser know where the Auth class is.

    评论
    解决 无用
    打赏 举报
  • 查看更多回答(1条)

相关推荐 更多相似问题