public function replace($values)
    {
        if (! is_array($values) && ! $values instanceof BaseCollection) {
            $values = func_get_args();
        }

        // Trash the current values
        $this->trashCurrentItems();

        // Build valid instances of the given values based on attribute data type
        $this->items = $this->buildValues($values);

        return $this;
    }
public function replace($values)
    {
        if (! is_array($values) && ! $values instanceof BaseCollection) {
            $values = func_get_args();
        }

        // Trash the current values
        $this->trashCurrentItems();

        // Build valid instances of the given values based on attribute data type
        $this->items = $this->buildValues($values);

        return $this;
    }
public function replace ( $ values ) { if ( ! is_array ( $ values ) && ! $ values instanceof BaseCollection ) { $ values = func_get_args ( ) ; } // Trash the current values $ this -> trashCurrentItems ( ) ; // Build valid instances of the given values based on attribute data type $ this -> items = $ this -> buildValues ( $ values ) ; return $ this ; }
Replace current values with the given values.

@param \Illuminate\Support\Collection|array $values

@return $this
Replace current values with the given values .