protected function ensureDoesNotExist($model) { if ($this->has($model)) { $this->related->remove($model); parent::ensureDoesNotExist($model); } }
protected function ensureDoesNotExist($model) { if ($this->related === $model) { $this->related = NULL; parent::ensureDoesNotExist($model); } }