【发布时间】:2021-09-08 13:22:50
【问题描述】:
我在使用 required_with 验证验证数组时遇到问题。即使我什么也没输入,它总是显示。从两天前开始我就收到了这个错误。我想检查一个字段是否插入值,另一个字段必须插入值。如果没有插入,另一个字段不需要插入。你能帮帮我吗?
这是我得到的错误,即使我输入了值。有什么解决方案吗? Error Message Image
验证请求代码。
'work_procedure[]'=>'nullable|required_with:times,work_points',
'times[]'=>'nullable|required_with:work_procedure',
'work_points[]'=>'nullable|required_with:work_procedure',
这是 Model.php
protected $fillable=[
'work_procedure',
'times',
'work_points',
];
【问题讨论】: