laravel sum row code example
Example 1: laravel eloquent sum column
Product::where('id',$id)->sum('quantity');
Example 2: laravel find query
return Destination::orderByDesc(
Flight::select('arrived_at')
->whereColumn('destination_id', 'destinations.id')
->orderBy('arrived_at', 'desc')
->limit(1)
)->get();