public function getRules(): array
{
return [
'submitForVerification' => [
new Required,
new BooleanValue,
],
'tasks' => [
new Each(
new Nested([
'push' => [
new Nested([
'isEnabled' => [
new Required(when: fn() => $this->submitForVerification),
new BooleanValue,
],
'content' => [
new Required(when: [???]),
],
])
],
])
)
],
];
}
It cannot be done? Or it'll be ugly solution.
What steps will reproduce the problem?
What is the expected result?
I can set Required validator for
contentdependent on his siblingisEnabledvalue.What do you get instead?
It cannot be done? Or it'll be ugly solution.
Additional info