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'
}),
2 Replies