© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•9mo ago•
3 replies
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
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

How to use TextColumn instead of SelectColumn?
FilamentFFilament / ❓┊help
3y ago
How to set TextColumn isHidden / Disabled but searchable?
FilamentFFilament / ❓┊help
3y ago
How to display the widgets instead of normal table in relation manager?
FilamentFFilament / ❓┊help
11mo ago
TextColumn->icon() disabled by formatStateUsing()
FilamentFFilament / ❓┊help
3y ago