2017-09-26 40 views
0

Hell0,我没有安装过程中出现错误,一切都(使用此指令):颤无法识别验证::用户在Laravel 5.4

https://github.com/thedevdojo/chatter 

很好,没有错误过去了,一切都看起来不错,但当我登录时它不会识别我的用户。

dd(Auth :: user());返回false。

如果我在视图&控制器中使用“Auth :: guard('webfront') - > user()”而不是“Auth :: user()”,它将获取会话并向我显示要发布的表单。但是,当我尝试发布时,它会将我重定向回登录页面(而我仍然登录)。

只是有一件事困扰着我...主系统控制器是:

“应用程序\ HTTP \控制器\前端...”和“应用程序\ HTTP \ \控制器前端\验证“

以及视图的相同文件夹名称。起初,当我试图强制“使用Auth;”使用“App \ Http \ Controllers \ Frontend \ Auth;”但比它的返回,找不到类“App \ Http \ Controllers \ Frontend \ Auth”

有没有人有这个问题?任何解决方案谢谢:-)

回答

0

固定:对于每个人都有同样的问题。您必须编辑chatter.php配置文件,并将您已使用的中间件的ID添加到其字段中,例如:

'middleware' => [ 
    'global'  => ['web'], 
    'home'  => [], 
    'discussion' => [ 
     'index' => [], 
     'show' => [], 
     'create' => ['auth:webfront'], 
     'store' => ['auth:webfront'], 
     'destroy' => ['auth:webfront'], 
     'edit' => ['auth:webfront'], 
     'update' => ['auth:webfront'], 
    ], 
    'post' => [ 
     'index' => [], 
     'show' => [], 
     'create' => ['auth:webfront'], 
     'store' => ['auth:webfront'], 
     'destroy' => ['auth:webfront'], 
     'edit' => ['auth:webfront'], 
     'update' => ['auth:webfront'], 
    ], 
    'category' => [ 
     'show' => [], 
    ], 
],