diff --git a/src/Components/Concerns/HasIcon.php b/src/Components/Concerns/HasIcon.php index 014b3c9..5fa1a31 100644 --- a/src/Components/Concerns/HasIcon.php +++ b/src/Components/Concerns/HasIcon.php @@ -2,17 +2,18 @@ namespace CodeWithDennis\SimpleAlert\Components\Concerns; +use BackedEnum; use Closure; use CodeWithDennis\SimpleAlert\Components\Enums\IconAnimation; use Illuminate\Contracts\Support\Htmlable; trait HasIcon { - protected string|Htmlable|Closure|null $icon = null; + protected string|BackedEnum|Htmlable|Closure|null $icon = null; protected Closure|IconAnimation|null $iconAnimation = null; - public function icon(string|Htmlable|Closure|null $icon, Closure|IconAnimation|null $animation = null): static + public function icon(string|BackedEnum|Htmlable|Closure|null $icon, Closure|IconAnimation|null $animation = null): static { $this->icon = $icon; $this->iconAnimation = $animation; @@ -25,7 +26,7 @@ public function getIconAnimation(): ?string return $this->evaluate($this->iconAnimation)?->value ?? null; } - public function getIcon(): ?string + public function getIcon(): BackedEnum|string|null { return $this->evaluate($this->icon); }