in array laravel validation code example
Example 1: how validate array in laravel in request
$validator = Validator::make($request->all(), [
"names" => "required|array|min:3",
"names.*" => "required|string|distinct|min:3",
]);
Example 2: laravel validation array
$data = $request->validate([
"name" => "required|array|min:3",
"name.*" => "required|string",
]);