How to use TextColumn instead of SelectColumn?

Hi all,

I am new to filament, started looking at it last week.

Can you please help, I basically want to display TextColum instead of SelectColumn based on this?

public static function table(Table $table): Table
{
return $table
->columns([
SelectColumn::make('status')
->options([
'0' => 'Draft',
'1' => 'Complete',
'2' => 'Incomplete',
])


Would you be able to advise please, much appreciated.

thanks
#TextColumn #SelectColumn
Solution
TextColumn::make('status')
  ->formatStateUsing(function(string $state) {
    return match($state) {
      '1' => 'Complete',
      '2' => 'Incomplete',
      default => 'Draft',
    };
  })


For enums see https://filamentphp.com/docs/3.x/support/enums
Was this page helpful?