Answers for "laravel collection average"

PHP
0

laravel collection average

$average = collect([['foo' => 10], ['foo' => 10], ['foo' => 20], ['foo' => 40]])->avg('foo');

// 20

$average = collect([1, 1, 2, 4])->avg();

// 2
Posted by: Guest on July-24-2021

Code answers related to "laravel collection average"

Browse Popular Code Answers by Language