SubmitQualificationRequest.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Http\Requests\Coach;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class SubmitQualificationRequest extends FormRequest
  5. {
  6. public function authorize()
  7. {
  8. return true;
  9. }
  10. public function rules()
  11. {
  12. return [
  13. 'qual_type' => 'required|integer|in:1,2,3',
  14. 'qual_photo' => 'required|string|max:2048',
  15. 'business_license' => 'required|string|max:2048',
  16. 'health_cert' => 'required|string|max:2048',
  17. ];
  18. }
  19. public function messages()
  20. {
  21. return [
  22. 'qual_type.required' => '资质类型不能为空',
  23. 'qual_type.integer' => '资质类型必须是整数',
  24. 'qual_type.in' => '资质类型只能是1(初级)、2(中级)或3(高级)',
  25. 'qual_photo.required' => '资质证书照片不能为空',
  26. 'qual_photo.string' => '资质证书照片格式不正确',
  27. 'qual_photo.max' => '资质证书照片数据过大',
  28. 'business_license.required' => '营业执照照片不能为空',
  29. 'business_license.string' => '营业执照照片格式不正确',
  30. 'business_license.max' => '营业执照照片数据过大',
  31. 'health_cert.required' => '健康证照片不能为空',
  32. 'health_cert.string' => '健康证照片格式不正确',
  33. 'health_cert.max' => '健康证照片数据过大',
  34. ];
  35. }
  36. }