using ENUM class on Forms->Select Field return error
I get the follwing error trying to use an ENUM on a SelectField:
Filament\Forms\Components\Select::getOptions(): Return value must be of type array, string returned
my enum:
My cast:
My SelectField in Forms:
What am i missing?
php 8.2
5 Replies
That should work, I don't see anything wrong. I literally just now implemented an enum with a Select, and compared your code to mine. Too tired to delve into it now tho. Will check back after some zzz zzz.
Im pretty sure it worked the whole time. Can you try updating composer dependencies to the latest versions of filament pls?
I'm definitely on latest (3.0.62).
Schema ...
Model ...
Enum ...
Filament\Forms\Components\Select::getOptions(): Return value must be of type array, string returnedI get that whenever I forget to import my Enum into my Form class's file headers. ie:
use \App\Enums\Durations;
or use the FQDN: ->options(\App\Enums\Durations::class)