I need to add validation for a dynamic array whose elements can be strings or subsequent arrays containing strings, but I can't find a way to save this rule.
My current validation:
$data = $request->validate([
'answers' => ['required', 'array'],
'answers.*' => ['required', 'max:255'],
'answers.*.*' => ['nullable', 'string', 'max:255']
]);
Sample input:
"answers" => array:3 [▼
4 => array:1 [▼
0 => "Tests"
1 => "Tests 2"
]
5 => "Test"
6 => "Yes"
]
