Laravel obtenha média de uma coluna
$avgStar = Model::avg('star');
macke
$avgStar = Model::avg('star');
{
$average = collect([1, 5, 9, 5])->avg();
// Output : 5
$average = collect([10,20,30])->average();
// Output : 10
}