<?php

declare(strict_types=1);

namespace app\admin\validate;

use think\Validate;

class DataRecycle extends Validate
{
    protected $failException = true;

    protected $rule = [
        'name'        => 'require',
        'controller'  => 'require|unique:security_data_recycle',
        'data_table'  => 'require',
        'primary_key' => 'require',
    ];

    protected $message = [];

    protected $field = [];

    protected $scene = [
        'add'  => ['name', 'controller', 'data_table', 'primary_key'],
        'edit' => ['name', 'controller', 'data_table', 'primary_key'],
    ];

    public function __construct()
    {
        $this->field = [
            'name'        => __('Name'),
            'controller'  => __('Controller'),
            'data_table'  => __('Data Table'),
            'primary_key' => __('Primary Key'),
        ];
        parent::__construct();
    }
}
