在Laravel中验证数组元素

时间:2019-01-29 15:53:09

标签: laravel validation

我有一个数组

$dataArray =

    [
        0 => [
          "member_email" => 4849092427.0
          "first_name" => "Tom"
        ]

        1 => [
          "member_email" => 4849092427.0
          "first_name" => "Clement"
        ]
    ]

和一个验证器

$validator = Validator::make($dataArray, [
                "*.member_number" => "date",
                "*.first_name" => "email",
            ]);

我已将验证器设置为失败,但没有失败。我要去哪里错了?

0 个答案:

没有答案