Infolist TextEntry with enum casted attribute
Hi, how can I display an enum value when it is cast to an enum class in an infolist textentry? Im getting Object of class enum could not be converted to string.
Also how would I display multiple values using AsEnumCollection::class:EnumClass cast?
Solution:Jump to solution
https://filamentphp.com/docs/3.x/support/enums#using-the-enum-label-with-a-text-entry-in-your-infolist
If you use a TextEntry with the Infolist Builder, and it is cast to an enum in your Eloquent model, Filament will automatically use the HasLabel interface to display the enum's label instead of its raw value....
2 Replies
Solution
https://filamentphp.com/docs/3.x/support/enums#using-the-enum-label-with-a-text-entry-in-your-infolist
If you use a TextEntry with the Infolist Builder, and it is cast to an enum in your Eloquent model, Filament will automatically use the HasLabel interface to display the enum's label instead of its raw value.
thanks