Skip to content

Commit

Permalink
Fix old getDirtyDraftableAttributes logic after having switched to an…
Browse files Browse the repository at this point in the history
… 'on model' approach
  • Loading branch information
Kurt Friars committed Mar 8, 2024
1 parent 78d4792 commit 1a1b963
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Concerns/HasPublishableAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 1a1b963

Please sign in to comment.