TextColumn not picking up label from enum

I have an enum like this
enum MyStatus: int implements HasLabel
{
case Active = 1;
case Disabled = -1;

public function getLabel(): string|Htmlable|null
{
return match ($this) {
self::Active => 'Active',
self::Disabled => 'Disabled',
};
}
}
enum MyStatus: int implements HasLabel
{
case Active = 1;
case Disabled = -1;

public function getLabel(): string|Htmlable|null
{
return match ($this) {
self::Active => 'Active',
self::Disabled => 'Disabled',
};
}
}
In a form select, it works as expected, but it in a TextColumn I see the enum value instead of the label.
TextColumn::make('status')
// ->badge() // thought maybe this would affect it
->sortable(),
TextColumn::make('status')
// ->badge() // thought maybe this would affect it
->sortable(),
What am I missing? FWIW, I also tried with a string enum, same result
3 Replies

Did you find this page helpful?