erp-backend/app/Http/Requests/LoginRequest.php
2026-04-01 17:07:04 +08:00

42 lines
996 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class LoginRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'email' => 'required|string|email',
'password' => 'required|string|min:6',
];
}
/**
* Get custom messages for validator errors.
*/
public function messages(): array
{
return [
'email.required' => '邮箱不能为空',
'email.email' => '邮箱格式不正确',
'password.required' => '密码不能为空',
'password.min' => '密码至少6个字符',
];
}
}