diff --git a/packages/tables/src/Filters/Concerns/HasIndicators.php b/packages/tables/src/Filters/Concerns/HasIndicators.php index 19d3b885c40..324fe5f7190 100644 --- a/packages/tables/src/Filters/Concerns/HasIndicators.php +++ b/packages/tables/src/Filters/Concerns/HasIndicators.php @@ -5,14 +5,15 @@ use Closure; use Filament\Tables\Filters\Indicator; use Illuminate\Support\Arr; +use Illuminate\Contracts\Support\Htmlable; trait HasIndicators { protected string | Closure | null $indicateUsing = null; - protected Indicator | string | Closure | null $indicator = null; + protected Indicator | string | Htmlable | Closure | null $indicator = null; - public function indicator(Indicator | string | Closure | null $indicator): static + public function indicator(Indicator | string | Htmlable | Closure | null $indicator): static { $this->indicator = $indicator; @@ -59,7 +60,7 @@ public function getIndicators(): array return $indicators; } - public function getIndicator(): Indicator | string + public function getIndicator(): Indicator | string | Htmlable { $state = $this->getState(); diff --git a/packages/tables/src/Filters/Indicator.php b/packages/tables/src/Filters/Indicator.php index 40cc2684fa9..3074267eab2 100644 --- a/packages/tables/src/Filters/Indicator.php +++ b/packages/tables/src/Filters/Indicator.php @@ -5,6 +5,7 @@ use Closure; use Filament\Support\Components\Component; use Filament\Support\Concerns\HasColor; +use Illuminate\Contracts\Support\Htmlable; class Indicator extends Component { @@ -12,7 +13,7 @@ class Indicator extends Component protected bool | Closure $isRemovable = true; - protected string | Closure $label; + protected string | Htmlable | Closure $label; protected string | Closure | null $removeField = null; @@ -20,24 +21,24 @@ class Indicator extends Component protected string $evaluationIdentifier = 'indicator'; - final public function __construct(string | Closure $label) + final public function __construct(string | Htmlable | Closure $label) { $this->label($label); } - public static function make(string | Closure $label): static + public static function make(string | Htmlable | Closure $label): static { return app(static::class, ['label' => $label]); } - public function label(string | Closure $label): static + public function label(string | Htmlable | Closure $label): static { $this->label = $label; return $this; } - public function getLabel(): string + public function getLabel(): string | Htmlable { return $this->evaluate($this->label); }