public function associate(Model $model) { $this->parent->setAttribute($this->foreignKey, $model->getKey()); return $this->parent->setRelation($this->relation, $model); }