SocialPublishRequest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Http\Requests\Site;
  3. use App\Http\Requests\Request;
  4. class SocialPublishRequest extends Request
  5. {
  6. /**
  7. * Determine if the user is authorized to make this request.
  8. *
  9. * @return bool
  10. */
  11. public function authorize()
  12. {
  13. return true;
  14. }
  15. /**
  16. * Get the validation rules that apply to the request.
  17. *
  18. * @return array
  19. */
  20. public function rules()
  21. {
  22. if (!$this->ajax()) {
  23. return [];
  24. }
  25. return [
  26. 'checkIds' => 'required|array',
  27. 'release_at' => 'required',
  28. 'release_interval' => 'required|numeric',
  29. 'social_ids' => 'required',
  30. 'label_id' => 'nullable',
  31. // 'pin_board'=>'nullable'
  32. ];
  33. }
  34. public function attributes()
  35. {
  36. return [
  37. 'checkIds' => '页面',
  38. 'release_at' => '发布时间',
  39. 'release_interval' => '发布间隔',
  40. 'social_ids' => '社交账号类型',
  41. ];
  42. }
  43. }