From 318303396d57d301ca6a35dcd4da082e2f5080fb Mon Sep 17 00:00:00 2001 From: Kurt Friars Date: Thu, 14 Mar 2024 16:54:47 -0400 Subject: [PATCH] Handle the wasRecentlyCreated case for wasChanged() --- src/Concerns/IsPublishable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Concerns/IsPublishable.php b/src/Concerns/IsPublishable.php index 7d3b80b..bda45fe 100644 --- a/src/Concerns/IsPublishable.php +++ b/src/Concerns/IsPublishable.php @@ -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(); }