© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Macklin

unique field erroring on update

Having issues with the unqiue constraint requiring the field to be unique, even on updating. It should only be unique if it is being changed to something different or while being created, not when it is unchanged.

                Forms\Components\Fieldset::make('Route')
                    ->relationship('route')
                    ->schema([
                        Forms\Components\TextInput::make('title'),
                        Forms\Components\TextInput::make('slug')->unique(),
                        Forms\Components\TextInput::make('old_slug')->unique(),
                    ])
                Forms\Components\Fieldset::make('Route')
                    ->relationship('route')
                    ->schema([
                        Forms\Components\TextInput::make('title'),
                        Forms\Components\TextInput::make('slug')->unique(),
                        Forms\Components\TextInput::make('old_slug')->unique(),
                    ])
image.png
Solution
Just like normal laravel you have to tell it it ignore itself. Example from the docs.
Field::make('email')->unique(ignorable: $ignoredUser)
Field::make('email')->unique(ignorable: $ignoredUser)
Jump to solution
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

Unique field on a form
FilamentFFilament / ❓┊help
3y ago
Unique validation error on update
FilamentFFilament / ❓┊help
2y ago
Repeater unique field
FilamentFFilament / ❓┊help
3y ago
unique rules depending on other field
FilamentFFilament / ❓┊help
15mo ago