title: Access model in Laravel blade
body: <p>I tried to access model TemporarySubject via my blade file. If the data exist in the model, my blade will show button red in colour else it shows a button with the default colour</p>
  
  <p>Below are some of my code in blade. It seems like the code doesn't run into the @if @else condition because the output shows all button with red colour even the data do not exist in the model</p>
  
  <pre><code>@if ($rows-&gt;S4=='1')
    @if (App\TemporarySubject::where('subject_name','=','S4'))
     &lt;button class="btn btn-danger btn-mini" title="Digital Logic"&gt;SCSR1013(S4)&lt;/button&gt;
    @else
     &lt;button class="btn btn-mini" title="Digital Logic"&gt;SCSR1013(S4)&lt;/button&gt;
    @endif
  @endif
  </code></pre>
  
  <p>The output should show the button in default colour because in temporary_subjects does not contain subject_name with 'S4' value, but it shows a red colour button instead. Hopefully, someone can help me with this problem. Thanks in advance</p>