Juan Felipe Zapata Moreno 927c46aa2e fix: login con username
2026-01-19 16:12:46 -06:00

47 lines
1.1 KiB
PHP

<?php namespace App\Http\Requests\Auth;
/**
* @copyright (c) 2025 Notsoweb Software (https://notsoweb.com) - All Rights Reserved
*/
use Illuminate\Foundation\Http\FormRequest;
/**
* Solicitud de login
*
* @author Moisés Cortés C. <moises.cortes@notsoweb.com>
*
* @version 1.0.0
*/
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 [
'username' => ['required', 'string'],
'password' => ['required', 'min:8'],
];
}
public function messages(): array
{
return [
'username.required' => 'El usuario es requerido',
'password.required' => 'La contraseña es requerida',
'password.min' => 'La contraseña debe tener al menos 8 caracteres',
];
}
}