QrcodeGroup.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Http\Requests\OpenWork\Contactway;
  3. use App\Http\Requests\BaseRequest;
  4. /**
  5. * 账号管理接口校验规则
  6. *
  7. * @author 刘相欣
  8. *
  9. * */
  10. class QrcodeGroup extends BaseRequest
  11. {
  12. /**
  13. * 获取应用于请求的规则
  14. *
  15. * @return array
  16. */
  17. public function rules()
  18. {
  19. // 返回结果
  20. return [
  21. 'name' => 'required',
  22. 'id' => 'required|integer|gt:0',
  23. 'status' => 'required|integer',
  24. ];
  25. }
  26. // 场景列表
  27. protected $scenes = [
  28. 'add' => ['name'],
  29. 'edit' => ['id','name'],
  30. 'set_status' => ['id', 'status'],
  31. ];
  32. /**
  33. *
  34. * @return array
  35. */
  36. public function messages()
  37. {
  38. return [
  39. 'name.required' => '名称必填',
  40. 'id.required' => 'ID未知',
  41. 'id.integer' => 'ID格式错误',
  42. 'id.gt' => 'ID格式错误',
  43. 'status.required' => '状态未知',
  44. 'status.integer' => '状态格式错误',
  45. ];
  46. }
  47. }