Laravel Collection Public API: reduce
The reduce method is used to reduce a collection into a single item. It iterates over the collection and applies a callback function on each item. The reduce method accepts an optional initial value that will become the initial carry value of the callback function. If no items are in the collection, the initial value is returned. In the provided...