hello I have a table called gallery_category_contents
| language | title | gallery_category_id |
|---|---|---|
| en | FISH | 1 |
| en | DOGS | 2 |
and my request rules are like this
public function rules()
{
return [
"language"=>[
"required",
Rule::unique('gallery_category_contents','language')->ignore($this->gallery_category_id,'gallery_category_id')
],
"title"=>[
"string",
"required"
]
];
}
what i want is that it doesn't add already existing language with same gallery_category_id
For example, English language has been added to 1 gallery_category_id, so it should not be added again. my current code works, but it affects all the data in that table, that is, it also affects category 2
how to do it?