Config.php 616 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\admin\validate;
  3. use think\Validate;
  4. class Config extends Validate
  5. {
  6. protected $failException = true;
  7. protected $rule = [
  8. 'name' => 'require|unique:config',
  9. ];
  10. /**
  11. * 验证提示信息
  12. * @var array
  13. */
  14. protected $message = [];
  15. /**
  16. * 字段描述
  17. */
  18. protected $field = [
  19. ];
  20. /**
  21. * 验证场景
  22. */
  23. protected $scene = [
  24. 'add' => ['name'],
  25. ];
  26. public function __construct()
  27. {
  28. $this->field = [
  29. 'name' => __('Variable name'),
  30. ];
  31. parent::__construct();
  32. }
  33. }