diff --git a/packages/tables/src/Grouping/Group.php b/packages/tables/src/Grouping/Group.php index ce77200cea..d48913dbba 100644 --- a/packages/tables/src/Grouping/Group.php +++ b/packages/tables/src/Grouping/Group.php @@ -8,6 +8,7 @@ use Carbon\CarbonInterface; use Closure; use Filament\Support\Components\Component; use Filament\Support\Contracts\HasLabel as LabelInterface; +use Filament\Tables\Table; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Model; @@ -35,7 +36,7 @@ class Group extends Component protected ?Closure $scopeQueryByKeyUsing = null; - protected string | Closure | null $label = null; + protected string | Htmlable | Closure | null $label = null; protected string $id; @@ -88,7 +89,7 @@ class Group extends Component return $this; } - public function label(string | Closure | null $label): static + public function label(string | Htmlable | Closure | null $label): static { $this->label = $label; @@ -181,7 +182,7 @@ class Group extends Component return $this->id; } - public function getLabel(): string + public function getLabel(): string | Htmlable { return $this->evaluate($this->label) ?? (string) str($this->getId()) ->beforeLast('.') @@ -191,7 +192,7 @@ class Group extends Component ->ucfirst(); } - public function getDescription(Model $record, ?string $title): ?string + public function getDescription(Model $record, string | Htmlable | null $title): string | Htmlable | null { if (! $this->getDescriptionFromRecordUsing) { return null;