正在显示
1 个修改的文件
包含
10 行增加
和
0 行删除
| @@ -16,6 +16,16 @@ class AsideTicketStoreRequest extends FormRequest | @@ -16,6 +16,16 @@ class AsideTicketStoreRequest extends FormRequest | ||
| 16 | return true; | 16 | return true; |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | + protected function prepareForValidation() | ||
| 20 | + { | ||
| 21 | + if ($this->has('close_wechat')) { | ||
| 22 | + $this->merge([ | ||
| 23 | + // 将 "true", "1", "on", "yes" 等转换为 true,其他转换为 false | ||
| 24 | + 'close_wechat' => filter_var($this->close_wechat, FILTER_VALIDATE_BOOLEAN), | ||
| 25 | + ]); | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + | ||
| 19 | /** | 29 | /** |
| 20 | * Get the validation rules that apply to the request. | 30 | * Get the validation rules that apply to the request. |
| 21 | * | 31 | * |
-
请 注册 或 登录 后发表评论