laravel-nestedset
laravel-nestedset copied to clipboard
unique on parent_id
Hello everybody.
Today in my validate I have the following:
$ request-> validate ([ 'name' => "required | unique: docscategories, name, NULL, id, deleted_at, NULL, parent_id, NULL | max: 255", 'observation' => 'max: 255', ]);
In the figure below, I would like you to ignore it when the user enters an identical name, but for a parent_id who is a member.
-
Cat A (Allow)
-
- SubCat A (Allow)
-
Cat B (Allow)
-
- SubCat B (Allow)
-
Cat C (Allow)
-
- Sub Cat B (Allow)
-
- Sub Cat B (Do not allow)
-
Sub Cat B (Allow)
My actual database.

I have all deleted, but when there is a deleted it lets insert. This rule is already created in the validation!