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 -

c++ - Fill edges and center of array/vector with different values -

sql - calculate weighted average for each day and id based on time intervals in PostgreSQL -