In this example, I have a user's table & I want to get the user who have maximum and minimum amount. For that I used the following code
$price = DB::table('users')->max('amount');
$price = DB::table('users')->min('amount');
And by using the below code, you can get the total amount of all the users.
$total = DB::table('users')->sum('amount');
0 Comment(s)