Laravel 8 min() {#collection-method}
min
方法返回指定键的最小值:
$min = collect([[‘foo’ => 10], [‘foo’ => 20]])->min(‘foo’);
// 10
$min = collect([1, 2, 3, 4, 5])->min();
// 1
min
方法返回指定键的最小值:
$min = collect([[‘foo’ => 10], [‘foo’ => 20]])->min(‘foo’);
// 10
$min = collect([1, 2, 3, 4, 5])->min();
// 1