<?php

namespace Modules\User\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class LoginRequest extends FormRequest
{

    /**
     * Notes   : 字段验证规则
     *
     * @Date   : 2021/3/11 4:59 下午
     * @Author : <Jason.C>
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'username' => 'required',
            'password' => 'required|min:6',
        ];
    }

    /**
     * Notes   : 验证错误提示消息
     *
     * @Date   : 2021/3/11 4:59 下午
     * @Author : <Jason.C>
     * @return string[]
     */
    public function messages(): array
    {
        return [
            'username.required' => '用户名必须填写',
            'password.required' => '密码必须填写',
            'password.min'      => '密码最少为:min个字符',
        ];
    }

}
