ProjectRequest.php 927 字节
<?php

namespace App\Http\Requests\Aside\Project;

use Illuminate\Foundation\Http\FormRequest;

/**
 * Class ProjectRequest
 * @package App\Http\Requests\Aside\product
 * @author zbj
 * @date 2023/4/25
 */
class ProjectRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'=>'required|max:50',
            'remark'=>'max:200',
        ];
    }

    public function messages()
    {
        return [
            'title.required' => '请输入部门名称',
            'title.max' => '部门名称不能超过50个字符',
            'remark.max' => '备注不能超过200个字符',
        ];
    }

}