laravel validation conditional code example
Example 1: laravel validate integer between
'item' => 'required|integer|between:1,10',
Example 2: validate each value from array laravel
$validator = Validator::make($request->all(), [
"names" => "required|array|min:3",
"names.*" => "required|string|distinct|min:3",
]);
Example 3: laravel validation
"foo" => "Your input was invalid!",
"accepted" => "The :attribute must be accepted.",
// The rest of the validation error messages...