LMongo\Eloquent\Model::replicate PHP Method

replicate() public method

Clone the model into a new, non-existing instance.
public replicate ( ) : Model
return Model
    public function replicate()
    {
        $attributes = array_except($this->attributes, array($this->getKeyName()));
        with($instance = new static())->setRawAttributes($attributes);
        return $instance->setRelations($this->relations);
    }
Model