Laravel 8 tutorial - Aggregate methods | sum,avg,min,max etc

preview_player
Показать описание
In this laravel 8 video tutorial, we learn what is Aggregate function and how to use them with database a simple way. This video is made by anil Sidhu in the English language.

steps of video
aggregate methods in Laravel
what is aggregate methods
Make controller
Use max, avg, min, count, sum
Interview Question for aggregate in laravel
this tutorial also work in laravel 9
laravel tutorial from scratch

Рекомендации по теме
Комментарии
Автор

Please support me by subscribe, like and comment :) thank you

codestepbystep
Автор

Interview Question: Yes it is possible, first we need to keep them into the values like` min and max, and then return them in once
$min =
$max =
return "min - ".$min." max - ".$max;

sargisgrigoryan
Автор

such a nice name and work of "Code STEP by STEP".

ashokbishwas
Автор

ans


return $data=['minval'=> $minval, 'maxval'=>$maxval];

mihirpatel
Автор

Answer of the interview question :
php codes with echo or print works perfectly:
$min =
$max =
echo "min - ".$min." max - ".$max;

ashokbishwas
Автор

Hi bro, I tried for the answer but I couldn't find it. I found that RETURN will pass only one value and code after return will not be executed in a function. Am not sure whether this is correct or not but I tried this. Please correct me if I am wrong. Thank you.



function aggregate(){



echo "minimum is &nbsp&nbsp".$min."<br>maximum is&nbsp".$max;
}
}

saikumarkandikonda
Автор

I think Query Builder is far easier and faster and better than Elequent ORM, Laravel should phase out ORM and develop deeply query builder. which is useful in all situations.

ashokbishwas
Автор

thank you so much sir to your tutorial.

lenisuryani
Автор

Interview Question: we need to use selectRaw.
$data = AS minId, MAX(id) AS maxId'))->get();

mohamed-pjqw
Автор

Interview Question - answer : return asMinId, max(id) as MaxId')->get();

shindeanita
Автор

$min=

$combine= ['min'=>$min, 'max'=>$max];
foreach ($combine as $key => $value) {
echo $key. ' '.$value.'<br>';
}

nadanpanchi
Автор

its not possible please tell me answer

gemabout