Skip to content

Commit

Permalink
Handle the wasRecentlyCreated case for wasChanged()
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Friars committed Mar 14, 2024
1 parent aedc9a9 commit 3183033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Concerns/IsPublishable.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ public function isNotPublished(): bool

public function wasPublished(): bool
{
return $this->wasChanged($this->workflowColumn())
return ($this->wasChanged($this->workflowColumn()) || $this->wasRecentlyCreated)
&& $this->getOriginal($this->workflowColumn()) === $this->publishedState();
}

public function wasUnpublished(): bool
{
return $this->wasChanged($this->workflowColumn())
return ($this->wasChanged($this->workflowColumn()) || $this->wasRecentlyCreated)
&& $this->getOriginal($this->workflowColumn()) !== $this->publishedState();
}

Expand Down

0 comments on commit 3183033

Please sign in to comment.