RenewFormRequest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Http\Requests\Process;
  3. use App\Http\Requests\Request;
  4. class RenewFormRequest 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. 'contract_deadline' => 'required',
  27. 'contract_amount' => 'required',
  28. 'keyword_goal' => 'required|numeric',
  29. 'article_goal' => 'required|numeric',
  30. 'link_goal' => 'required|numeric',
  31. 'other_demand' => 'nullable',
  32. ];
  33. }
  34. public function attributes()
  35. {
  36. return [
  37. 'contract_deadline' => '合同期限',
  38. 'contract_amount' => '合同金额',
  39. 'keyword_goal' => '关键词达标数',
  40. 'link_goal' => '外链平台数',
  41. 'article_goal' => '软文达标数',
  42. 'other_demand' => '其他需求',
  43. ];
  44. }
  45. }