order by with column sum laravel eloquent code example Example: order by sum() laravel Auth::user()->orderByRaw('SUM(points) DESC')->get();