79092934

Date: 2024-10-16 07:44:25
Score: 0.5
Natty:
Report link

The accepted answer is ok for small sets of data, but for large sets you might want to use a subquery to order the results:

Flight::orderBy(
    Term::select('price')
        ->whereColumn('terms.flight_id', 'flights.id')
        ->orderBy('price', 'desc')
        ->take(1),
'desc')->get();
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: mpartarrieu