<?php


namespace app\admin\validate;


class BannerValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'title' => 'nullable',
        'image' => 'require',
        'link' => 'nullable',
        'type' => 'nullable',
        'sort' => 'nullable|numeric',
    ];

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'title' => '标题',
        'image' => '图片',
        'link' => '链接',
        'type' => '类型',
        'sort' => '排序',
    ];

    /**
     * @notes 编辑场景
     */
    public function sceneEdit()
    {
        return $this->only(['id','title', 'image', 'link', 'type', 'sort']);
    }

    public function sceneId()
    {
        return $this->only(['id']);
    }

}