felixkiss / uniquewith-validator

Custom Laravel Validator for combined unique indexes
MIT License
389 stars 129 forks source link

unique_with can't validation on multiple column #123

Closed hellohasan closed 3 years ago

hellohasan commented 3 years ago

My code is that

'name' => "required|max:191|unique_with:academic_subjects,academic_class_id,ignore:{$id}",
'code' => "required|max:191|unique_with:academic_subjects,academic_class_id,ignore:{$id}",

Results: This combination of name, academic class id already exists.

on my database name and code same but academic_class_id is different so the result is false. How I can fix it.