【发布时间】:2019-02-28 19:57:27
【问题描述】:
在移动我的项目之前,一切都很好。在我将它从我的电脑移到笔记本电脑后,我的 @IF 语句停止工作。
例如,这是一段 navbar.blade.php 我的导航栏是根据帐户类型更改的,在移动项目后 if 命令不检查身份验证,所有用户都被视为 客人
@if(Auth::check())
@if(Auth::user()->Account_type == 'Student')
<li><a href="/myprojects">My projects</a></li>
@ENDIF
@if(Auth::user()->Account_type == 'Admin')
<li><a href="/AdminDashboard">Dashboard</a></li>
@ENDIF
@ENDIF
移动项目后我尝试过
Composer Install
Composer Update
composer dumpautoload
没有什么对我有用
【问题讨论】:
-
清除缓存后再试
-
将
@ENDIF更改为@endif -
使用
Auth::user()->Account_type === 'Student' -
@Davit 逻辑没有问题,它在我的电脑上运行
-
@Shibon 很遗憾没用