public function duplicateTo($model, $connection) {
		$this->write_connection = $connection; // Store the write database connection
		$clone = $this->duplicate($model); // Do a normal duplicate
		$this->write_connection = null; // Null out the connection for next run
		return $clone;
	}
public function duplicateTo($model, $connection) {
		$this->write_connection = $connection; // Store the write database connection
		$clone = $this->duplicate($model); // Do a normal duplicate
		$this->write_connection = null; // Null out the connection for next run
		return $clone;
	}
public function duplicateTo ( $ model , $ connection ) { $ this -> write_connection = $ connection ; // Store the write database connection $ clone = $ this -> duplicate ( $ model ) ; // Do a normal duplicate $ this -> write_connection = null ; // Null out the connection for next run return $ clone ; }
Clone a model instance to a specific database connection

@param  Illuminate\Database\Eloquent\Model $model
@param  string $connection A Laravel database connection
@return Illuminate\Database\Eloquent\Model The new model instance
Clone a model instance to a specific database connection