Variable.php 602 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\admin\validate\sms;
  3. use think\Validate;
  4. class Variable extends Validate
  5. {
  6. protected $failException = true;
  7. /**
  8. * 验证规则
  9. */
  10. protected $rule = [
  11. 'name' => 'require|unique:sms_variable',
  12. ];
  13. /**
  14. * 提示消息
  15. */
  16. protected $message = [
  17. ];
  18. /**
  19. * 验证场景
  20. */
  21. protected $scene = [
  22. 'add' => ['name'],
  23. 'edit' => ['name'],
  24. ];
  25. public function __construct()
  26. {
  27. $this->field = [
  28. 'name' => '变量名称',
  29. ];
  30. parent::__construct();
  31. }
  32. }