© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•4mo ago•
7 replies
foggy

TextColumn depending on database value....

Should be a simple one. I have a database table column "status".. that statuses are encoded as 1,2,3,4,5 and stored as an int.

On the Form used to create the table row, I have a Select:: thus:

                       Select::make('status')
                            ->label('Status')
                            ->required()
                            ->options([
                                '1' => 'Open',
                                '2' => 'Closed',
                                '3' => 'Waiting',
                                '4' => 'This',
                                '5' => 'That
                            ]),
                       Select::make('status')
                            ->label('Status')
                            ->required()
                            ->options([
                                '1' => 'Open',
                                '2' => 'Closed',
                                '3' => 'Waiting',
                                '4' => 'This',
                                '5' => 'That
                            ]),


...and this works. I render the page, hit the drop down, I see the options "Open", "Closed" etc but it's the number 1, 2, 3 etc goes in the database. Great!

My issue is then how do I display that on the table? I can't find a code snippet to plagiarise to do this! How do I display "Open", "Closed" etc depending on 1, 2, 3 etc in the database?

TIA!
Solution
I'd use mutators/accessors to centralise that transformation
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

Swap Panel Font depending on database value?
FilamentFFilament / ❓┊help
3y ago
Limit text on TextColumn depending on the breakpoint?
FilamentFFilament / ❓┊help
3y ago
TextColumn with subquery value
FilamentFFilament / ❓┊help
3y ago
sort TextColumn with multiple value
FilamentFFilament / ❓┊help
2y ago