I have an array of elements that i want to validate, this array have this form
{
"slugs" : {
1 : "prueba",
2 : "test"
}
Slugs is the input <input name="slugs[{{ $lang->id }}]"> and the numbers are the id of the language 1 = spanish / 2 = english.
What i want is to validate these field uniqueness, in a form request like this
public function rules()
{
$rules = [
//
'slugs.*' => Rule::unique('translation_entries')->where(function($query) {
//here i want to access the * that represent the lang id
//like this $query->where('lang_id','=',$query->*);
})
];
}
can i access the index * inside the unique Rule class?