diff --git a/src/Models/Campaign.php b/src/Models/Campaign.php index 3ffac05d..ff2409c8 100644 --- a/src/Models/Campaign.php +++ b/src/Models/Campaign.php @@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\MorphMany; +use Illuminate\Database\Eloquent\Casts\Attribute; /** * @property int $id @@ -388,4 +389,25 @@ public function allDraftsCreated(): bool return $this->active_subscriber_count === $this->messages()->count(); } + + /** + * Interact with `is_open_tracking` attribute. + */ + protected function isOpenTracking(): Attribute + { + return Attribute::make( + get: fn(mixed $value) => (bool)$value, + ); + } + + + /** + * Interact with `is_click_tracking` attribute. + */ + protected function isClickTracking($value) + { + return Attribute::make( + get: fn(mixed $value) => (bool)$value, + ); + } }