Applies a callback to a copy of all data in the collection
and returns the result.
public map ( callback $filter, array $options = [] ) : mixed | ||
$filter | callback | The filter to apply. |
$options | array | The available options are: - `'collect'`: If `true`, the results will be returned wrapped in a new `Collection` object or subclass. |
return | mixed | The filtered items. Will be an array unless `'collect'` is defined in the `$options` argument, then an instance of this class will be returned. |