我在 Laravel 中制作一页并使用表单请求进行验证。我在那个页面上有 2 个代码。
- 优惠券代码 2) 促销代码
我想设置条件,使这些代码可以为空,但填充时只需要一个。
我已经尝试过了,但没有得到正确的结果。
return [
'coupon_code' => 'nullable|required_without:promo_code',
'promo_code' => 'nullable|required_without:coupon_code'
];