<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\admin\validate;

use think\Validate;

/**
 * Description of Menu
 *
 * @author sgq
 */
class Menu extends Validate {

    protected $rule = [
        'name' => 'require|max:255',
        'url' => 'require|max:255',
        'code' => 'require|max:255|unique:sys_menu',
        'pcode' => 'max:255',
        'num' => 'require|integer'
    ];
    protected $message = [
        'name.require' => '请填写菜单名称!',
        'name.max' => '菜单名称最多255个字符!',
        'url.require' => '请填写请求地址!',
        'url.max' => '请求地址最多255个字符!',
        'code.require' => '请填写菜单编号!',
        'code.max' => '菜单编号最多255个字符!',
        'code.unique' => "菜单编号不能重复",
        'pcode.max' => '父级编号最多255个字符!',
        'num.require' => '请填写菜单排序!',
        'num.number' => "菜单排序必须是整数",
    ];

}
