调用未定义的方法Illuminate \ Session \ Store :: user()(视图:C:\ xampp \ htdocs \ vms_ut \ resources \ views \ layouts \ navbar.blade.php)(视图:C:\ xampp \ htdocs \ vms_ut \ resources \ views \ layouts \ navbar.blade.php)
查看
<ul class="navbar-nav">
<li><a href="{{url('/home')}}">Home</a></li>   
@if (Session::user()->level == 'Admin')
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">
Master <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="">Data</a></li>
<li><a href="">Warehouse</a></li>
</ul>
</li>
@else (Session::user()->level == 'Penyedia')
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">
Master <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="">Data</a></li>
</ul>
</li>
@endif
</ul>
查看
请帮助我
答案 0 :(得分:1)
您是指Auth而不是Session?
更改此行:
@if (Session::user()->level == 'Admin')
此行
@if (Auth::user()->level == 'Admin')
答案 1 :(得分:0)
您可以像这样使用会话外观:
for (; i < len ; i++) {
c = read();