2017-09-11 6 views
1

이것은 블레이드보기의 코드입니다. 나의 목적은 인증 된 사용자의 전자 메일 주소가 if 조건에서 일치하는 경우에만이 특정 HTML을 표시하는 것입니다. 이 ' 따옴표없이 {{ 괄호 그냥 Auth::user()->email 이상 \Auth::user()->email을 사용하지 않고올바른 @ @ Laravel 5.2의 블레이드보기에있는 구문

@if ('{{ Auth::user()->email }}' == '[email protected]') 
      <li> 
      <a href="{{ URL::route('UploadsHome') }}"><i class="fa fa-file-text" aria-hidden="true"></i>File Uploads</a> 
      </li> 
@endif 

답변

1

사용되어야한다로 현재 작동하지 않는 경우, 아래에 확인하시기 바랍니다.

@if (\Auth::user()->email == '[email protected]') 
    <li> 
    <a href="{{ URL::route('UploadsHome') }}"><i class="fa fa-file-text" aria-hidden="true"></i>File Uploads</a> 
    </li> 
@endif 
+0

이 작동! 감사! –

0

은 어쩌면이 작업 할 수 있습니다

@if (Auth::user()->email == '[email protected]') 
    //your code after authentication 
@else 
    //user not logged in 
@endif