我有这样的验证:
$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"和"路径"字段值并仅在先前的简单验证通过时执行。怎么做?