Используйте другой подход:
$grouped = [];
$trips = \App\Models\Trip::where('price', '>=', '100')->with('ratings')->get();
foreach($trips as $trip) {
foreach($trip->ratings as $rating) {
$grouped[$rating->rate][] = $trip;
}
}
Или используйте JOIN:
$trips = \App\Models\Trip::select('trips.*', 'ratings.rate')
->join('ratings', 'ratings.ratable_id', 'trips.id')
->where('ratings.ratable_type', 'App\Models\Trip')
->where('trips.price', '>=', '100')
->get();
$grouped = $trips->groupBy('rate');