F
Filamentβ€’3w ago
Novi

Table TextColumn of a toggle how to display Enabled / Disabled instead of 1 / 0?

Hi, as the title says really, I have a column that is stored as a simple 1 / 0 in the DB, but I need it to display to the viewer as Enabled / Disabled. My code looks like this: Tables\Columns\TextColumn::make('enable_live') ->badge() ->color(fn (string $state): string => match ($state) { '0' => 'gray', '1' => 'success', }) ->sortable(), I've read through the documentation and I've Googled extensively but I can't figure it out. Can anyone point me in the right direction?
Solution:
Ah, I found the answer, ->formatStateUsing sorry to bother you all πŸ™‚
Jump to solution
1 Reply
Solution
Novi
Noviβ€’3w ago
Ah, I found the answer, ->formatStateUsing sorry to bother you all πŸ™‚

Did you find this page helpful?