You can find the minimum value in a numeric collection using the min()
method provided by Illuminate Collections.
Here is an example of how to do it:
composer require illuminate/support
use Illuminate\Support\Collection;
$collection = new Collection([10, 5, 20, 8]);
min()
method on the collection to get the minimum value:$minValue = $collection->min();
echo $minValue; // Output: 5
That's it! You have found the minimum value in a numeric collection using Illuminate Collections.