I have a form that has only fields:
- question
- choice
Choice is an array because a question has more than answers and the user can add as many as I need.
I just need to validate that these aren't empty so I tried:
$validation = $this->c->validator->validate($request, [
'question' => v::notEmpty(),
'choice[]' => v::ArrayVal()->each()->notEmpty()
]);
But it doesn't let me save any entry. If I leave choice[] as "choice" it validates every entry. I assume the rule must be wrong.