Filtering ENUMS in option list

i have this options list
->form([
                                Forms\Components\Radio::make('type')
                                    ->label('Type')
                                    ->default('regular')
                                    ->options(PrintOptions::class)
                            ])

i want to hide 2 options if the $record->parts is null
this is my enum
enum PrintOptions: string implements HasLabel
{
    case REGULAR = 'regular';
    case AGGREGATE = 'aggregate';
    case LABEL = 'label';
    case RECEIPT = 'receipt';
    case DATAAUTH = 'authorization';
 
    public function getLabel(): ?string
    {
        return match ($this) {
            self::REGULAR => 'regular',
            self::AGGREGATE => 'aggregate',
            self::LABEL => 'label',
            self::RECEIPT => 'receipt',
            self::DATAAUTH => 'Data authorization',

        };
    }
}

i want to hide REGULAR and AGGREGATE
Was this page helpful?