query a prices table, finding me the companies with the most products. uses laravel and db query builder. grouping and ordering
$companies = DB::table('prices')
->select(DB::raw('company_id, COUNT(*) as total_products'))
->groupBy('company_id')
->orderBy('total_products', 'desc')
->get();