Enums for datalist attribute values

Hello Filament community,

I am really liking the use of enums in Filament. I wanted to ask if I can use them in datalist attributes in the form builder too? And if so, what would be best practices at the moment?

Thank you.
Solution
What about

->datalist(fn() => collect(Status::cases())->mapWithKeys(fn ($case) => [$case->value => $case->label()])) 


with Status class being the enum?
Was this page helpful?