タイトル: count / max / average (集計)
本稿はLaravelのクエリビルダーを用いた集計関数の使用方法をまとめた記事です。
count
|
$users = DB::table('users')->count(); |
max
|
$price = DB::table('orders')->max('price'); |
avg(average)
|
$price = DB::table('orders')->avg('price'); |