Laravel - 仅在上次传递时进行其他自定义验证

时间:2018-04-22 18:59:32

标签: laravel laravel-5 laravel-5.6 laravel-validation

我有这样的验证:

    $validator = Validator::make($request->all(), [
        'parent_id' => 'bail|required|integer|exists:tree_nodes,id',
        'name'      => 'bail|required|max:255',
        'position'  => 'bail|nullable|numeric',
        'path'      => 'bail|nullable|max:255'
    ]);

但我需要为"路径"进行额外的自定义验证。字段基于" parent_id"," name"和"路径"字段值并仅在先前的简单验证通过时执行。怎么做?

0 个答案:

没有答案