1.

How to use aggregate functions in Laravel?

Answer»

Laravel provides a variety of aggregate functions such as MAX, min, count,avg, and sum. We can call any of these functions after CONSTRUCTING our QUERY.

$users = DB::table(‘admin’)->count();
$maxComment = DB::table(‘blogs’)->max('comments');



Discussion

No Comment Found