© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
15 replies
@nasilemak

How to display an enum's label rather than value in a TextColumn?

My
Customer
Customer
model has a
priority
priority
column which stores any one of these values: 1, 2, 3.


class Customer extends Model
{
    public const PRIORITY_SELECT = [
        1 => 'Low',
        2 => 'Medium',
        3 => 'High',
    ];
}
class Customer extends Model
{
    public const PRIORITY_SELECT = [
        1 => 'Low',
        2 => 'Medium',
        3 => 'High',
    ];
}


How do I make
TextColumn::make('priority')
TextColumn::make('priority')
display the value instead of the key?

Here's what I have. However I don't want this displayed as a description but rather as the value itself.

Tables\Columns\TextColumn::make('priority')
    ->badge()
    ->description(fn (Customer $record): string => Customer::PRIORITY_SELECT[$record->priority])
    ->color(fn (string $state): string => match ($state) {
        '1' => 'gray',
        '2' => 'warning',
        '3' => 'success',
    }),
Tables\Columns\TextColumn::make('priority')
    ->badge()
    ->description(fn (Customer $record): string => Customer::PRIORITY_SELECT[$record->priority])
    ->color(fn (string $state): string => match ($state) {
        '1' => 'gray',
        '2' => 'warning',
        '3' => 'success',
    }),
Solution
Found the solution.
->formatStateUsing()
->formatStateUsing()
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

Sortable TextColumn based on Enum labels rather than query
FilamentFFilament / ❓┊help
2y ago
TextColumn not picking up label from enum
FilamentFFilament / ❓┊help
5mo ago
Enum trait in TextColumn
FilamentFFilament / ❓┊help
3y ago
TextColumn throwing an exception for the empty ENUM value
FilamentFFilament / ❓┊help
12mo ago