条件验证无法正常工作

Conditional validation not working properly

我正在尝试设置一个必须检查这个的条件验证:

所以在我的 blade 观点中:

@if ($riskfield->type == 'min_max')
<x-boilerplate::input type="number" name="values[min]" label="medicalrecords.min" required
    placeholder="medicalrecords.min_plc" autofocus="true" min="0" prepend-text="fas fa-signature">
</x-boilerplate::input>

<x-boilerplate::input type="number" name="values[max]" label="medicalrecords.max"
    placeholder="medicalrecords.max_plc" autofocus="true" min="0" prepend-text="fas fa-signature">
</x-boilerplate::input>
@elseif($riskfield->type == 'number')
<x-boilerplate::input type="number" name="values[number]" label="medicalrecords.number" required
    placeholder="medicalrecords.number_plc" autofocus="true" min="0"
    prepend-text="fas fa-signature">
</x-boilerplate::input>
@endif

并且在我的表单顶部还有一个隐藏字段:

<input type="hidden" name="riskfield_type" value="{{ $riskfield->type }}">

然后在store方法中有这个验证配置:

    $this->validate($request, [
        'riskfield_id'      => 'required',
        'riskarea_id'       => 'required',
        'values[min]'       => 'required_if:riskfield_type,==,min_max',
        'values[max]'       => 'required_if:riskfield_type,==,min_max',
        'values[number]'    => 'required_if:riskfield_type,==,number'
    ]);

现在的问题是,如果我同时填写 values[min]values[max],我会得到:

The values [min] field is required when the riskfield type is min_max.

这是一个错误还是我做错了什么?

尝试这样写验证:

'values.min' => 'required_if:riskfield_type,==,min_max',