title: Laravel conditional clause when for filtering value
body: <p>I have a event table with status o or 1.</p>
  
  <p>I have to filter the event with status 1,0 or ALL.</p>
  
  <p>I tried with laravel when conditional clause,its not working with value zero,other conditionals are working.</p>
  
  <pre><code>$status    = Input::get('status');
  $events    = DB::table('events')
            -&gt;select('events.*')
            -&gt;when($status, function ($query) use ($status) {
             return $query-&gt;where("events.status",$status);
             })
            -&gt;get();
  </code></pre>