F
Filamentβ€’14mo ago
urbycoz

How can I change the badge text in a textEntry?

I'm trying to use a TextEntry component in an Infolist to display a boolean in my database table. In the table, the value is stored as 1 or 0, but I'd really like to show a badge saying "active" or "inactive" instead. TextEntry::make('isActive') ->label('Account Status') ->badge() ->color(fn (string $state): string => match ($state) { '1' => 'success', '0' => 'danger' }),
Solution:
you can use formatStateUsing but better to use IconEntry πŸ™‚...
Jump to solution
2 Replies
Solution
Lara Zeus
Lara Zeusβ€’14mo ago
you can use formatStateUsing but better to use IconEntry πŸ™‚
urbycoz
urbycozOPβ€’14mo ago
Good shout. Looks better with IconEntry.
Want results from more Discord servers?
Add your server