ConfCheck.php 758 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/Apache-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\validate;
  8. use think\Validate;
  9. class ConfCheck extends Validate
  10. {
  11. protected $rule = [
  12. 'title' => 'require|unique:config,title^status',
  13. 'name' => 'require|alphaDash|unique:config,name^status',
  14. ];
  15. protected $message = [
  16. 'title.require' => '配置名称不能为空',
  17. 'title.unique' => '同样的配置名称已经存在',
  18. 'name.require' => '配置标识不能为空',
  19. 'name.alphaDash' => '配置标识只能是字母和数字,下划线_及破折号-',
  20. 'name.unique' => '同样的配置标识已经存在',
  21. ];
  22. }