<?php

namespace app\admin\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'username' => 'require|length:3,30|unique:user',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'username.require' => 'Username can not be empty',
        'username.length'  => 'Username must be 3 to 30 characters',
        'username.unique'  => 'Username already exist',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];
    
}
