code: public function replace($collection)
      {
          return $this->createFrom(array_replace($this->items, Arr::from($collection)));
      }
docs: Replaces items in this bag from the `$collection` by comparing keys and returns the result.
  
  @param iterable $collection The collection from which items will be extracted
  
  @return static