Laravel - Getting Started - Retrieving Aggregates

When interacting with Eloquent models, you may also use the count, sum, max, and other aggregate methods provided by the Laravel query builder. As you might expect, these methods return a scalar value instead of an Eloquent model instance:

    
    $count = Flight::where('active', 1)->count();
    
    $max = Flight::where('active', 1)->max('price');