Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’2y agoβ€’
5 replies
pinoooh

Enum in TextEntry of InfoList

Hi,
I have a model with an enum-property (cast) which I want to display in an infolist, but this gives me an Error:
TextEntry::make('model.enumProperty')
TextEntry::make('model.enumProperty')

this results in
Object of class App\Enums\MyEnum could not be converted to string
Object of class App\Enums\MyEnum could not be converted to string

I don't mind converting the value e.g. using
formatStateUsing
formatStateUsing
on the TextEntry but the code already fails on the name.

As a workaround I can do this, but this it's not very nice πŸ™‚
TextEntry::make('model.created_at')
    ->formatStateUsing(static function (Model $model): string {
        ...
    }
}
TextEntry::make('model.created_at')
    ->formatStateUsing(static function (Model $model): string {
        ...
    }
}

Any idea?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel β€’ Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Infolist TextEntry with enum casted attribute
FilamentFFilament / β“β”Šhelp
2y ago
Infolist TextEntry
FilamentFFilament / β“β”Šhelp
2y ago
Infolist - TextEntry - listWithLineBreaks
FilamentFFilament / β“β”Šhelp
2y ago
Infolist TextEntry label
FilamentFFilament / β“β”Šhelp
3y ago