Skip to content

Commit

Permalink
Merge pull request #1519 from bakaphp/hotfix-format-channel-pivot
Browse files Browse the repository at this point in the history
refact : cache
  • Loading branch information
kaioken authored Jun 14, 2024
2 parents 9b14a32 + a381bae commit 96c613a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Domains/Inventory/Channels/Models/Channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function discountedPrice(): Attribute
public function isPublished(): Attribute
{
return Attribute::make(
get: fn () => $this->pivot->is_published,
get: fn () => $this->pivot ? $this->pivot->is_published : ($this->attributes['is_published'] ?? true),
);
}

Expand Down

0 comments on commit 96c613a

Please sign in to comment.