PagesValidate.php 686 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 PagesValidate extends Validate
  10. {
  11. protected $rule = [
  12. 'title' => 'require',
  13. 'content' => 'require',
  14. 'name' => 'lower|min:3|unique:pages',
  15. ];
  16. protected $message = [
  17. 'title.require' => '页面名称不能为空',
  18. 'content.require' => '页面内容不能为空',
  19. 'name.lower' => 'URL文件名称只能是小写字符',
  20. 'name.min' => 'URL文件名称至少需要3个小写字符',
  21. 'name.unique' => '同样的URL文件名称已经存在',
  22. ];
  23. }