© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2mo ago•
4 replies
beety

Using an Enum class with Select in form

✅ Solved4️⃣v4
Hi. I'm trying to use an Enum class with a Select component. The form displays the options correctly but I get an error after submitting it.

This the enum class:
enum FeeType: string
{
    case Percentage = 'Percentage';
    case Flat = 'Flat';
}
enum FeeType: string
{
    case Percentage = 'Percentage';
    case Flat = 'Flat';
}

This is the form schema:
use App\Enums\FeeType;

public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->required(),
                Select::make('fee_type')
                    ->enum(FeeType::class)
                    ->required()
            ]);
    }
use App\Enums\FeeType;

public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('name')
                    ->required(),
                Select::make('fee_type')
                    ->enum(FeeType::class)
                    ->required()
            ]);
    }

This is the error I receive after the form is submitted:
LogicException
vendor\filament\forms\src\Components\Select.php:1502

Filament failed to validate the [data.fee_type] field\'s selected options because it did not have an [options()] or [getOptionLabelUsing()] configuration. Please use one of these methods to inform Filament which options are valid for this field.
LogicException
vendor\filament\forms\src\Components\Select.php:1502

Filament failed to validate the [data.fee_type] field\'s selected options because it did not have an [options()] or [getOptionLabelUsing()] configuration. Please use one of these methods to inform Filament which options are valid for this field.

I'd appreciate any advice or help.
Thanks.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Enum with form->select
FilamentFFilament / ❓┊help
3y ago
Error in Filament with PestPHP using form select in resource and enum
FilamentFFilament / ❓┊help
2y ago
using ENUM class on Forms->Select Field return error
FilamentFFilament / ❓┊help
3y ago
Using an enum with a toggle
FilamentFFilament / ❓┊help
2y ago