where('election_id', Util::getCurrentElection()) ->orderBy('position_id'); $positionId = request('position_id'); if ($positionId !== null && $positionId !== '' && (int) $positionId !== 0) { $q->where('position_id', (int) $positionId); } return $q->get(); } }