© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago•
5 replies
Arnold Schwarzenegger

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
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
string
enum, same result
Solution
https://filamentphp.com/docs/4.x/advanced/enums#using-the-enum-label-with-a-text-column-in-your-table
Enum tricks - Advanced - Filament
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Enum TextColumn badge() with label, icon and color
FilamentFFilament / ❓┊help
3y ago
Enum trait in TextColumn
FilamentFFilament / ❓┊help
3y ago
How to Enum on TextColumn method?
FilamentFFilament / ❓┊help
3y ago
How to display an enum's label rather than value in a TextColumn?
FilamentFFilament / ❓┊help
3y ago