© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
Rajunda

createOptionForm field validation

as title says, I have createOptionForm (it happens with editOptionForm too) on my select, but the unique validation is not working, did I miss something, any help?
->createOptionForm([
    Forms\Components\TextInput::make('name')
        ->label('Region / District / Area / Neighborhood')
        ->placeholder('Add region / district / area / neighborhood')
        ->required()
        ->unique(ignoreRecord: true)
        ->maxLength(255),
    Forms\Components\Toggle::make('is_published')
        ->label('Published')
        ->onIcon('heroicon-s-check')
        ->onColor('success')
        ->default(true),
    Forms\Components\Toggle::make('is_verified')
        ->label('Verified')
        ->onIcon('heroicon-s-check')
        ->onColor('success')
        ->default(true),
])
->createOptionForm([
    Forms\Components\TextInput::make('name')
        ->label('Region / District / Area / Neighborhood')
        ->placeholder('Add region / district / area / neighborhood')
        ->required()
        ->unique(ignoreRecord: true)
        ->maxLength(255),
    Forms\Components\Toggle::make('is_published')
        ->label('Published')
        ->onIcon('heroicon-s-check')
        ->onColor('success')
        ->default(true),
    Forms\Components\Toggle::make('is_verified')
        ->label('Verified')
        ->onIcon('heroicon-s-check')
        ->onColor('success')
        ->default(true),
])
Screenshot_2024-01-15_at_15.08.06.png
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

Create validation after field validation
FilamentFFilament / ❓┊help
15mo ago
Realtime field validation.
FilamentFFilament / ❓┊help
3y ago
Select field createOptionForm - save and continue
FilamentFFilament / ❓┊help
10mo ago
createOptionForm()
FilamentFFilament / ❓┊help
2y ago