<?php

namespace App\Http\Requests\Auth;

use Illuminate\Foundation\Http\FormRequest;

class LoginRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'username' => 'required|string|max:50',
            'password' => 'required|string|min:6|max:20',
        ];
    }

    public function messages(): array
    {
        return [
            'username.required' => '请输入用户名',
            'password.required' => '请输入密码',
            'password.min' => '密码至少6位',
            'password.max' => '密码最多20位',
        ];
    }
}
