Select with enum options bug in v4
I had a custom select extending Filament’s select, mainly to load enum options and set a default label (used repeatedly in the app). There’s also a cast so values are saved in the DB as the ordered days of the week. This worked fine in v3, but after upgrading I’m facing a bug: when editing a record, the already-selected days still appear as selectable options. If I pick them again, they duplicate and trigger a validation error on save. I suspect this might be related to my cast, but I’m not sure what changed.
I attached the code


3 Replies
What does the actual data look like, when you are trying to save?
I could imagine an issue with strings vs. ints? 🤔
the current data is an array of int, like [0,1,3]
I managed to get around the problem by changing the dropdown to a CheckboxList
not sure if it is related, but take a look
Filament
What's new in Filament v4? - Feature Overview by Leandro Ferreira -...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.