Collection Laravel en premier
collect([1, 2, 3, 4])->first(function ($value, $key) {
return $value > 2;
});
// 3
Cooperative Crab
collect([1, 2, 3, 4])->first(function ($value, $key) {
return $value > 2;
});
// 3
$first = $msgs->first(); // this does ->take(1) under the hood