OptionStateCast forces casting of option keys to integer
@Dan Harrin Any particular reason why would you force the type to integer? This last update does solve for keys starting with zero, but to be honest I currently don't agree. In my particular case, I have keys in this fashion "0011, 1025, 5568" which I'd like to keep as strings no matter what. Changing the type throughout the application can have side effects. My DB columns is JSON and the values get's stored as string in case of leading zeroes and integer in other cases.
I solved this with setting my custom cast with ->stateCasts(), now after this update: https://github.com/filamentphp/filament/pull/17902/files I solved with Cutom Laravel casts, since you keep numbers starting with zero as strings.
Not everyone knows this if they don't source dive and will have issues.
TLDR: Why do you force integer if ctype_digit return true? Maybe have an option that keeps string eg
->enforceStringState()
->enforceStringState()
.
I will consider a PR for this, but I'd just like to know the reasoning behind this. I may be wrong with my input.