whereKey($content->article_release_id)->value('status')); if ($status !== ReleaseStatus::Entwurf->value) { throw new DomainRuleException('Der Inhalt eines Artikel-Stands wird nur im Entwurf festgeschrieben.'); } }); static::updating(function (): void { throw new DomainRuleException('Der festgeschriebene Inhalt eines Artikel-Stands ist unveränderlich.'); }); } public function release(): BelongsTo { return $this->belongsTo(ArticleRelease::class, 'article_release_id'); } public function elementVersion(): BelongsTo { return $this->belongsTo(ContentElementVersion::class, 'content_element_version_id'); } }