SysAppVersionRequest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Http\Requests\Admin\Setting;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Http\Request;
  5. class SysAppVersionRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. *
  10. * @return bool
  11. */
  12. public function authorize()
  13. {
  14. return true;
  15. }
  16. /**
  17. * Get the validation rules that apply to the request.
  18. *
  19. * @return array
  20. */
  21. public function rules(Request $request)
  22. {
  23. return [
  24. 'version' => 'integer',
  25. 'apkurl' => 'required',
  26. 'is_upgrade_force' => 'required',
  27. 'is_download_force' => 'required',
  28. 'hot_upgrade_url' => 'required',
  29. 'upgrade_comments' => 'required',
  30. ];
  31. }
  32. public function messages()
  33. {
  34. return [
  35. 'version.integer' => '版本号必须是数字',
  36. 'apkurl.required' => '下载地址不能为空',
  37. 'is_upgrade_force.required' => '是否强制不能为空',
  38. 'is_download_force.required' => '是否需要下载不能为空',
  39. 'hot_upgrade_url.required' => '热更新下载地址不能为空',
  40. 'upgrade_comments.required' => '更新内容不能为空',
  41. ];
  42. }
  43. }