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