vendor/laravel/framework/src/Illuminate/Support/Collection.php
/**
     * Run a map over each of the items.
     *
     * @param  callable  $callback
     * @return static
     */
Run a map over each of the items.
@param  callable  $callback
@return static
Run a map over each of the items . @param callable $callback @return static
public function map(callable $callback)
    {
        $keys = array_keys($this->items);
        $items = array_map($callback, $this->items, $keys);
        return new static(array_combine($keys, $items));
    }
public function map ( callable $ callback ) { $ keys = array_keys ( $ this -> items ) ; $ items = array_map ( $ callback , $ this -> items , $ keys ) ; return new static ( array_combine ( $ keys , $ items ) ) ; }
Run a map over each of the items.
Run a map over each of the items .