Here is my validator:
$validator = Validator::make($request->all(), [
'considerations' => 'required',
'product_id.*' => "required"
]);
It validates considerations as well. If $request be lack of considerations item, it throws:
The considerations field is required.
Which is right. But it doesn't care about product_id. If I don't send that parameter it passes the validation as well. It will throw an error only if I send product_id[0] and no value for it. Then it will throw:
The product_id.0 field is required.
But if I don't send product_id parameter, it doesn't care and doesn't throw any error. Why? And how can I fix it?