groupBy('winning_bidder_num') ->orderBy('bidders.bidder_assigned_number') ->get(); $winning_bidder_num = ''; foreach ($winning_bidder_num_results as $winning_bidder_num_result) { $winning_bidder_num .= ''; } return $winning_bidder_num; } }