title: Laravel - Nested if
body: <p>I want to check if user already logged in and user is female I show specific image otherwise show another image. Here is my code:</p>
  
  <pre><code>@if(Auth::check())
  
      &lt;a id = "login-popup-title" href="profile" &gt;
        profile
  
          @if ( {{Auth::User()-&gt;gender}}  == "w" )
              &lt;img src="assets/img/profile-f.png"&gt;
          @else
              &lt;img src="assets/img/profile-m.png"&gt;
          @endif
      &lt;/a&gt;
  @else
      &lt;a data-toggle="modal" data-target="#regModal"&gt;register / login
          &lt;img src="assets/img/lock.png"&gt;
      &lt;/a&gt;
  @endif
  </code></pre>
  
  <p>In our table, we save user's gender information as <code>w</code> (woman) and <code>m</code> (man). </p>
  
  <p>But I get an error: </p>
  
  <blockquote>
    <p>FatalErrorException in 33957561dccca78dc8674528d604ac88fdbdaef8.php line 74:
        syntax error, unexpected '&lt;'</p>
  </blockquote>
  
  <p>How to do that?</p>