-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select field on enum type when using generate #15218
base: 4.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually people also pair this with an enum Eloquent model cast, or even use the enum class instead of an enum column. How about detecting on the model if an enum cast is used, and if it is pass the enum class name to the ->options()
? And if there is no enum cast and the column is an enum type, then do this instead.
@danharrin I went through a lot of research on how to set class as an argument. Thanks to the |
5170a9d
to
71ee66f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danharrin Can you verify the changes?
Thanks, I will take on the changes from here |
Description
When using
--generate
withphp artisan make:filament-resource
,enum
table type will generateForms\Components\Select
.Along with:
options
from allowed arrayIt follows the basic label transformation script (kebab -> replace -> ucfirst) for options.
Visual changes
Functional changes
composer cs
command.