Retrieving Results: Aggregates

$users = DB::table('users')->count();

$price = DB::table('orders')->max('price');
$price = DB::table('orders')
                ->where('finalized', 1)
                ->avg('price');

Determining If Records Exist

Return DB::table('orders')->where('finalized', 1)->exists();

return DB::table('orders')->where('finalized', 1)->doesntExist();

Retrieving Results: Aggregates — Structure map

Clickable & Draggable!

Retrieving Results: Aggregates — Related pages: