标签:手机 ber tom post 验证码 nbsp erro col between
验证规则
$validate = new Validate( [ ‘user_name‘ => ‘require|mobile‘, ‘password‘ => ‘require|max:16|min:8‘, ‘verify_code‘ => ‘require‘, ‘type‘ => ‘number|between:0,1‘, ], [‘phone.require‘ => ‘手机号必填‘, ‘phone.mobile‘ => ‘手机号格式错误‘, ‘password.require‘ => ‘密码不能为空‘, ‘password.max‘ => ‘密码设置8-16之间‘, ‘password.min‘ => ‘密码设置8-16之间‘, ‘verify_code.require‘ => ‘验证码不能为空‘, ‘type.between‘ => ‘在0和1之间‘, ] );
验证方法
if (!$validate->check($request->post())) { $this->apiResult(CustomError::OPERATION_SUCCSESS, [], $validate->getError()); }
标签:手机 ber tom post 验证码 nbsp erro col between
原文地址:https://www.cnblogs.com/camg/p/12777540.html