KeywordRequest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2019/5/10 0010
  6. * Time: 14:13
  7. */
  8. namespace App\Http\Requests\Rank;
  9. use App\Http\Requests\Request;
  10. class KeywordRequest extends Request
  11. {
  12. /**
  13. * Determine if the user is authorized to make this request.
  14. *
  15. * @return bool
  16. */
  17. public function authorize()
  18. {
  19. return true;
  20. }
  21. /**
  22. * Get the validation rules that apply to the request.
  23. *
  24. * @return array
  25. */
  26. public function rules()
  27. {
  28. if (!$this->ajax()) {
  29. return [];
  30. }
  31. return [
  32. // 'sn' => 'required',
  33. // 'level' => 'required',
  34. 'keyword' => 'required',
  35. 'chinese_keyword' => 'required',
  36. // 'page_title' => 'required',
  37. 'page_url' => 'required',
  38. 'search_num' => 'required',
  39. ];
  40. }
  41. public function attributes()
  42. {
  43. return [
  44. 'sn' => '序号',
  45. 'level' => '层级',
  46. 'keyword' => '关键词',
  47. 'chinese_keyword' => '中文关键词',
  48. 'page_title' => '页面标题',
  49. 'page_url' => '着陆页',
  50. 'search_num' => '搜索量',
  51. ];
  52. }
  53. }