I can validate two table columns for uniqueness by customizing the where query like this.
'email' => [
'required',
Rule::unique('users')->where(function ($query) {
return $query->where('account_id', $this->request('account_id'));
})
]
How would i do a similar thing when validating an array of data?
'email.*' => [
'required',
Rule::unique('users')->where(function ($query) {
// How can i customize the query per array element?
})
]