DrugValidator.php 980 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Repositories\Validators\TCM;
  3. use \Prettus\Validator\Contracts\ValidatorInterface;
  4. use \Prettus\Validator\LaravelValidator;
  5. /**
  6. * Class DrugValidator.
  7. *
  8. * @package namespace App\Repositories\Validators\TCM;
  9. */
  10. class DrugValidator extends LaravelValidator
  11. {
  12. /**
  13. * Validation Rules
  14. *
  15. * @var array
  16. */
  17. protected $rules = [
  18. ValidatorInterface::RULE_CREATE => [
  19. "name" => 'required',
  20. "type" => 'required',
  21. "unit" => 'required',
  22. "area" => 'required',
  23. "remark" => 'sometimes',
  24. "sort" => 'required',
  25. "status" => 'required',
  26. ],
  27. ValidatorInterface::RULE_UPDATE => [
  28. "name" => 'required',
  29. "type" => 'required',
  30. "unit" => 'required',
  31. "area" => 'required',
  32. "remark" => 'sometimes',
  33. "sort" => 'required',
  34. "status" => 'required',
  35. ],
  36. ];
  37. }