ShopValidator.php 790 B

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