RealAuthRequest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Http\Requests\Coach\Auth;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class RealAuthRequest extends FormRequest
  5. {
  6. public function authorize(): bool
  7. {
  8. return true;
  9. }
  10. public function rules(): array
  11. {
  12. return [
  13. 'real_name' => 'required|string|max:50',
  14. 'id_card' => 'required|string|size:18',
  15. 'id_card_front_photo' => 'required|string|max:255',
  16. 'id_card_back_photo' => 'required|string|max:255',
  17. 'id_card_hand_photo' => 'required|string|max:255'
  18. ];
  19. }
  20. public function messages(): array
  21. {
  22. return [
  23. 'real_name.required' => '真实姓名不能为空',
  24. 'real_name.max' => '真实姓名不能超过50个字符',
  25. 'id_card.required' => '身份证号不能为空',
  26. 'id_card.size' => '身份证号必须是18位',
  27. 'id_card_front_photo.required' => '身份证正面照片不能为空',
  28. 'id_card_front_photo.max' => '身份证正面照片地址不能超过255个字符',
  29. 'id_card_back_photo.required' => '身份证反面照片不能为空',
  30. 'id_card_back_photo.max' => '身份证反面照片地址不能超过255个字符',
  31. 'id_card_hand_photo.required' => '手持身份证照片不能为空',
  32. 'id_card_hand_photo.max' => '手持身份证照片地址不能超过255个字符'
  33. ];
  34. }
  35. }