VideoRequest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Http\Requests\Admin;
  3. use App\Http\Requests\Request;
  4. class VideoRequest extends Request
  5. {
  6. public function authorize()
  7. {
  8. return true;
  9. }
  10. /**
  11. * Get the validation rules that apply to the request.
  12. *
  13. * @return array
  14. */
  15. public function rules()
  16. {
  17. return [
  18. 'title' => 'required|between:2,255',
  19. 'keywords' => 'max:255',
  20. 'synopsis' => 'max:255',
  21. 'url' => 'required|between:2,255',
  22. ];
  23. }
  24. public function messages()
  25. {
  26. return [
  27. 'title.required' => '标题不能为空',
  28. 'title.between' => '标题只能为2~255字符',
  29. 'keywords.max' => '关键词最大只能为255字符',
  30. 'synopsis.max' => '摘要最大只能为255字符',
  31. 'url.required' => '视频地址不能为空',
  32. 'url.between' => '视频地址只能为2~255字符',
  33. ];
  34. }
  35. }