You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
960 B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request\v3;
  4. use App\Request\BaseFormRequest;
  5. class UserBindTelRequest extends BaseFormRequest
  6. {
  7. /**
  8. * Get the validation rules that apply to the request.
  9. */
  10. public function rules(): array
  11. {
  12. return [
  13. 'user_id' => 'required|nonempty|exists_enable:ims_cjdc_user,id',
  14. 'tel' => 'required|nonempty|tel',
  15. 'verify_code' => 'required|nonempty|numeric|strlen:6,6',
  16. ];
  17. }
  18. /**
  19. * @return array
  20. */
  21. public function messages(): array
  22. {
  23. return [
  24. 'user_id.*' => ':attribute未登录或无效',
  25. 'tel.*' => ':attribute无效',
  26. 'verify_code.*' => ':attribute格式有误',
  27. ];
  28. }
  29. public function attributes(): array
  30. {
  31. return [
  32. 'user_id' => '用户',
  33. 'tel' => '手机号码',
  34. 'verify_code' => '验证码',
  35. ];
  36. }
  37. }