Skip to content

Commit d30b0ca

Browse files
Merge pull request #49 from CodeWithDennis/45-4x-support-heroicon-enums
`4.x` support icon enums
2 parents 7f68701 + f6dc07d commit d30b0ca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Components/Concerns/HasIcon.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace CodeWithDennis\SimpleAlert\Components\Concerns;
44

5+
use BackedEnum;
56
use Closure;
67
use CodeWithDennis\SimpleAlert\Components\Enums\IconAnimation;
78
use Illuminate\Contracts\Support\Htmlable;
89

910
trait HasIcon
1011
{
11-
protected string|Htmlable|Closure|null $icon = null;
12+
protected string|BackedEnum|Htmlable|Closure|null $icon = null;
1213

1314
protected Closure|IconAnimation|null $iconAnimation = null;
1415

15-
public function icon(string|Htmlable|Closure|null $icon, Closure|IconAnimation|null $animation = null): static
16+
public function icon(string|BackedEnum|Htmlable|Closure|null $icon, Closure|IconAnimation|null $animation = null): static
1617
{
1718
$this->icon = $icon;
1819
$this->iconAnimation = $animation;
@@ -25,7 +26,7 @@ public function getIconAnimation(): ?string
2526
return $this->evaluate($this->iconAnimation)?->value ?? null;
2627
}
2728

28-
public function getIcon(): ?string
29+
public function getIcon(): BackedEnum|string|null
2930
{
3031
return $this->evaluate($this->icon);
3132
}

0 commit comments

Comments
 (0)