Enum TextColumn badge() with label, icon and color

I have this enum class

<?php

namespace App\Enums;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum SubstitutionStatusEnum: string implements HasColor, HasIcon, HasLabel
{
    case Suspended = 'suspended';
    case Accepted = 'accepted';
    case Rejected = 'rejected';

    public function getColor(): string | array | null
    {
        return match ($this) {
            self::Suspended => 'primary',
            self::Accepted => 'success',
            self::Rejected => 'danger',
        };
    }

    public function getIcon(): ?string
    {
        return match ($this) {
            self::Suspended => 'heroicon-o-ellipsis-horizontal-circle',
            self::Accepted => 'heroicon-o-check-circle',
            self::Rejected => 'heroicon-o-x-circle',
        };
    }

    public function getLabel(): ?string
    {    
        return match ($this) {
            self::Suspended => 'Suspended Acceptance',
            self::Accepted => 'Accepted Acceptance',
            self::Rejected => 'Rejected Acceptance',
        };
    }
}



and in my Resurce i've

                Tables\Columns\TextColumn::make('accepted_status')
                    ->label('Status')
                    ->badge()
                    ->sortable(),

but i only see a badge right coloured with enum value (suspended, accepted, ecc...) but i can't see the icon and the label. How can i get the labels and the icon inside the badge?

Thanks
Was this page helpful?