Enum with form->select

Why is it working for table->TextColumn but not for form->select?
<?php

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

enum TitreEnum: int implements HasLabel
{
    case M = 0;
    case MME = 1;    
    
    public function getLabel(): ?string
    {
        return match ($this) {
            self::M => 'M.',
            self::MME => 'Mme',                
        };
    }
}

Filament\Forms\Components\Select::getOptions(): Return value must be of type array, string returned
Solution
OK a final review before we debug this:

1- is the enum class included in the resource file?
use App\Enums\TitreEnum


2- is the enum class included in the model file?

3- is it setup in
protected $casts
?
Was this page helpful?