Je zou zoiets kunnen proberen
$query = DB::table('elements');
$query->where('some_field', 'some_value');
// Conditionally add another where
if($type) $query->where('type', 1);
// Conditionally add another where
if($lang) $query->where('lang', 'EN');
$rows = $query->get();
Controleer ook dit antwoord .