-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathHasIcon.php
More file actions
32 lines (24 loc) · 777 Bytes
/
HasIcon.php
File metadata and controls
32 lines (24 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace CodeWithDennis\SimpleAlert\Components\Concerns;
use Closure;
use CodeWithDennis\SimpleAlert\Components\Enums\IconAnimation;
use Illuminate\Contracts\Support\Htmlable;
trait HasIcon
{
protected string|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
{
$this->icon = $icon;
$this->iconAnimation = $animation;
return $this;
}
public function getIconAnimation(): ?string
{
return $this->evaluate($this->iconAnimation)?->value ?? null;
}
public function getIcon(): ?string
{
return $this->evaluate($this->icon);
}
}