How would I go about ordering a sum in Laravel
Currently, using
Auth::user()->activities()->groupBy('attempts_id')->sum('points');
Will only give me the first row. I need to order by that sum in descending order and grab the first item.
Using ->get()
at the end results in an error:
Call to a member function get() on a non-object