Filament Enum
In TextColumn I want to show
case USD
How can I? In text column show me us dollar
.
9 Replies
It will show value of enum case.
You can also use HasLabel:
https://filamentphp.com/docs/3.x/support/enums#enum-labels
Yes I'm using hasLabel.
I want to show USD like that
You can use formatStateUsing then EnumClass:from()?
And did you implement the getLabel() method as shown in the docs?
Have you casted your field in the model?
no
🤦♂️ that's what you get when you don't read docs
Filament Daily
YouTube
Filament: Enum Classes to Re-Use and Auto-Style
If you have a set of key-value options in the forms and tables, you may use PHP Enum classes to avoid repeating those options.
Official docs: https://filamentphp.com/docs/3.x/support/enums