当有验证需求是,传递的多个字段,必须有一个有值

这时候就可以使用required_without_all 来实现

 

        $rules = [
            'student_id' => 'required_without_all:student_id,ucid|integer',
            'ucid' => 'required_without_all:student_id,ucid|integer'
        ];

 

比如上面的student_id 和 ucid必须有一个有值

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
相关资源
相似解决方案