AttachValidator.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Repositories\Validators\Course;
  3. use \Prettus\Validator\Contracts\ValidatorInterface;
  4. use \Prettus\Validator\LaravelValidator;
  5. /**
  6. * Class CourseAttachValidator.
  7. *
  8. * @package namespace App\Repositories\Validators;
  9. */
  10. class AttachValidator extends LaravelValidator
  11. {
  12. /**
  13. * Validation Rules
  14. *
  15. * @var array
  16. */
  17. protected $rules = [
  18. ValidatorInterface::RULE_CREATE => [
  19. 'name' => 'required',
  20. 'course_id' => 'required|integer',
  21. 'course_video_id' => 'nullable|integer',
  22. 'path' => 'required|integer',
  23. 'sort' => 'nullable|integer',
  24. 'status' => 'nullable|integer'
  25. ],
  26. ValidatorInterface::RULE_UPDATE => [
  27. 'name' => 'required',
  28. 'course_id' => 'required|integer',
  29. 'course_video_id' => 'nullable|integer',
  30. 'path' => 'required|integer',
  31. 'sort' => 'nullable|integer',
  32. 'status' => 'nullable|integer'
  33. ],
  34. ];
  35. }