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(),
                    ])
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)
Was this page helpful?