I am trying to apply the suggestions provided in this question How to validate array in Laravel?
So my validation is
'topics' => 'required|array'
Topics are required
This works well especially if topics is an array greater than 1
unfortunately is I pass []
an empty array the validation fails
How can I validate that the input is an array, Its not null and empty array is allowed?
Below attempt fails
'topics' => 'required|array|min:0',
Topics are required
Below works, the problem is that even null values are permitted
'topics' => 'array',
'topics' => 'nullable|array'
– Espresso