I want to implement the validation use the Laravel required_if with multiple conditions.
I have an array of objects and want to validate that the attribute of the object will be required if the type=image and the isUsed of the object is false.
return request()->validate([
'sets.*.attribute' => 'required_if:type=image && sets.*.isUsed=false',
]);
How can I archive it?