Figured out the answer. I should append it to $building the where operation. This is Laravel fluent works
$searchFilter = arrray('id'=>true);
$building = new Building();
if (isset($searchFilter['id']))
{
// need to append it to building to make it work
$building = $building->where('id','=', 6);
}
return $building->paginate(20);