amontamas
amontamas
FFilament
Created by amontamas on 5/1/2025 in #❓┊help
Enum select key is not the constant but the value
I tried to make a Select field in my form with an 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
19 replies