title: Laravel 4.2 blade: check if empty
body: <p>In Laravel blade you can do: </p>
  
  <pre><code>{{ $variable or 'default' }}
  </code></pre>
  
  <p>This will check if a variable is set or not. I get some data from the database, and those variables are always set, so I can not use this method.</p>
  
  <p>I am searching for a shorthand 'blade' function for doing this:</p>
  
  <pre><code>{{ ($variable != '' ? $variable : '') }}
  </code></pre>
  
  <p>It is hard to use this piece or code for doing this beacuse of, I do not know how to do it with a link or something like this:</p>
  
  <pre><code>&lt;a href="{{ $school-&gt;website }}" target="_blank"&gt;{{ $school-&gt;website }}&lt;/a&gt;
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>{{ ($school-&gt;website != '' ? '&lt;a href="{{ $school-&gt;website }}" target="_blank"&gt;{{ $school-&gt;website }}&lt;/a&gt;' : '') }}
  </code></pre>
  
  <p>But, it does not work. And, I would like to keep my code as short as possible ;)</p>
  
  <p>Can someone explain it to me?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I do not use a foreach because of, I get a single object  (one school) from the database. I passed it from my controller to my view with: </p>
  
  <pre><code> $school = School::find($id);
   return View::make('school.show')-&gt;with('school', $school);
  </code></pre>
  
  <p>So, I do not want to make an <code>@if($value != ''){}</code> around each $variable (like $school->name).</p>