php - Correct @If syntax in the blade view for Laravel 5.2 -


this code in blade view. purpose specific html show if authenticated user's email address matches in if condition. please check below, not working should be

@if ('{{ auth::user()->email }}' == 'evangelism.sec@gmail.com')           <li>             <a href="{{ url::route('uploadshome') }}"><i class="fa fa-file-text" aria-hidden="true"></i>file uploads</a>           </li> @endif 

use without ' quotes , without {{ brackets use auth::user()->email or better \auth::user()->email.

@if (\auth::user()->email == 'evangelism.sec@gmail.com')   <li>     <a href="{{ url::route('uploadshome') }}"><i class="fa fa-file-text" aria-hidden="true"></i>file uploads</a>   </li> @endif 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -