-
Notifications
You must be signed in to change notification settings - Fork 149
Closed
Description
Hello, and first thanks for this great package!
I have an array like this:
[
'products' => [
'10' => [
'quantity' => 8
'has_notes' => 1
'notes' => ''
],
'12' => [
'quantity' => 0
'notes' => ''
],
'14' => [
'quantity' => 0
'notes' => ''
],
]
]
Basically I'd like that, for each array item, the field 'notes' is required if corresponding 'has_notes' field is present and it's 1 (it's a checkbox, so some items do not have this)
I tried with the following rule, but with no luck:
'products' => 'array',
'products.*.notes' => 'required_if:products.*.has_notes,1',
Is there a way to do this or do I have to create a custom rule?
Thanks :-)
Metadata
Metadata
Assignees
Labels
No labels