protected function setRelationConnection($model) { if ($model instanceof Eloquent) { $model->setConnection($this->getConnectionName()); } }