© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
F
Filament
•
10mo ago
•
18 replies
amontamas
Enum select key is not the constant but the value
I tried to make a
Select
Select
field in my form with an
Enum
Enum
. I used this documentation for it
:
https://filamentphp.com/docs/3.x/support/enums#enum-labels
But when it is saved the values writing into the database
, not the constant
, what is the expected behavior
(I think
)
.
Here is the Enum
:
https://github.com/sajt/iingatlanegyszer-filament/blob/main/app/Enums/County.php
Here is the Model
(where is the form and the cast
)
:
https://github.com/sajt/iingatlanegyszer-filament/blob/main/app/Models/City.php
And of course the resource what is using getForm from the model
:
https://github.com/sajt/iingatlanegyszer-filament/blob/main/app/Filament/Resources/CityResource.php
So
, when I save the form the county value is
'Budapest
' not BUDAPEST
GitHub
iingatlanegyszer-filament/app/Enums/County.php at main · sajt/iing...
Contribute to sajt
/iingatlanegyszer
-filament development by creating an account on GitHub
.
GitHub
iingatlanegyszer-filament/app/Models/City.php at main · sajt/iinga...
Contribute to sajt
/iingatlanegyszer
-filament development by creating an account on GitHub
.
GitHub
iingatlanegyszer-filament/app/Filament/Resources/CityResource.php a...
Contribute to sajt
/iingatlanegyszer
-filament development by creating an account on GitHub
.
Enums - Core Concepts - Filament
Solution
I needed somyhing like this
:
case BUDAPEST = 'BUDAPEST';
case BUDAPEST = 'BUDAPEST';
Jump to solution
Filament
Join
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Was this page helpful?
Yes
No
Similar Threads
Recent Announcements
Similar Threads
Filter enum value from select enum options (get all enum values but selected ones)
F
Filament / ❓┊help
2y ago
enum value in Forms\Components\Select
F
Filament / ❓┊help
2y ago
Select box key-value pair
F
Filament / ❓┊help
2y ago
Hydrate Select with key => value state
F
Filament / ❓┊help
2y ago