diff --git a/src/Concerns/HasPublishableAttributes.php b/src/Concerns/HasPublishableAttributes.php index 025c24a..80af2e0 100644 --- a/src/Concerns/HasPublishableAttributes.php +++ b/src/Concerns/HasPublishableAttributes.php @@ -167,10 +167,11 @@ public function hasDirtyDraftableAttributes(): bool public function getDirtyDraftableAttributes(): array { - if ($this->draft === null) { - return $this->attributesForDraft(); - } + $excluded = array_merge( + $this->excludedFromDraftByDefault(), + $this->excludedFromDraft() + ); - return array_diff_assoc($this->draft, $this->attributesForDraft()); + return array_diff_key($this->getDirty(), array_flip($excluded)); } }