<?php

namespace App\Http\Requests\Admin;

use App\Http\Requests\Request;
class VideoRequest extends Request
{
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'        => 'required|between:2,255',
            'keywords'     => 'max:255',
            'synopsis'     => 'max:255',
            'url'          => 'required|between:2,255',
        ];
    }

    public function messages()
    {
        return [
            'title.required'           => '标题不能为空',
            'title.between'            => '标题只能为2~255字符',
            'keywords.max'             => '关键词最大只能为255字符',
            'synopsis.max'             => '摘要最大只能为255字符',
            'url.required'             => '视频地址不能为空',
            'url.between'              => '视频地址只能为2~255字符',
        ];
    }
}
