ChapterValidator.php 747 B

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