我是Laravel的新手并选择了一个维护系统。
我有这条规则:
protected $rules = array(
'per_vlr_principal_rte' => 'required_if:per_fase_processual,2',
'per_vlr_juros_rte' => 'required_if:per_fase_processual,2',
'per_vlr_principal_rdo' => 'required_if:per_fase_processual,1,2',
'per_vlr_juros_rdo' => 'required_if:per_fase_processual,1,2',
'per_vlr_principal_perito' => 'required_if:per_fase_processual,2',
'per_vlr_juros_perito' => 'required_if:per_fase_processual,2',
'per_vlr_homologado' => 'required_if:per_fase_processual,2',
'per_qte_rte' => 'required',
'per_competencias' => 'required',
'per_qte_laudo' => 'required',
'per_dt_calculo' => 'required'
);
我想知道以下代码是否正确:
'per_vlr_principal_rdo' => 'required_if:per_fase_processual,1,2',
'per_vlr_juros_rdo' => 'required_if:per_fase_processual,1,2',
仅当值为1时才会进行验证。
如何解决?