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