<?php

declare(strict_types=1);

namespace app\admin\validate;

use think\Validate;

class AdminRule extends Validate
{
    protected $failException = true;

    protected $rule = [
        'type'  => 'require',
        'title' => 'require',
        'name'  => 'require|unique:admin_rule',
    ];

    protected $message = [];

    protected $field = [];

    protected $scene = [
        'add'  => ['type', 'title', 'name'],
        'edit' => ['type', 'title', 'name'],
    ];

    public function __construct()
    {
        $this->field = [
            'type'  => __('type'),
            'title' => __('title'),
            'name'  => __('name'),
        ];
        parent::__construct();
    }
}
