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.

45 lines
947 B

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Request\v3;
  4. use App\Request\BaseFormRequest;
  5. class UserUpdateRequest 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',
  14. 'nick_name' => 'required|nonempty',
  15. 'avatar' => 'required|nonempty',
  16. 'openid' => 'required|nonempty',
  17. 'unionid' => 'required|nonempty',
  18. 'country' => 'string',
  19. 'province' => 'string',
  20. 'city' => 'string',
  21. 'gender' => 'string',
  22. 'language' => 'string',
  23. ];
  24. }
  25. /**
  26. * @return array
  27. */
  28. public function messages(): array
  29. {
  30. return [
  31. '*.*' => ':attribute无效',
  32. ];
  33. }
  34. public function attributes(): array
  35. {
  36. return parent::attributes();
  37. }
  38. }