Photo by Ben Griffiths on UnsplashList some Aggregates methods provided by query builder in Laravel?Raja Muhammad Asher·Jun 17, 2023·1 min read count max min avg sum use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); $price = DB::table('orders')->max('price'); $price = DB::table('orders') ->where('finalized', 1) ->avg('price'); PHPLaravel Share this