Co-authored-by: Juan Felipe Zapata Moreno <zapata_pipe@hotmail.com> Reviewed-on: #1
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php namespace App\Http\Requests\Netbien;
|
|
/**
|
|
* @copyright (c) 2025 Notsoweb Software (https://notsoweb.com) - All Rights Reserved
|
|
*/
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Str;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
/**
|
|
* Almacenar rol
|
|
*
|
|
* @author Moisés Cortés C. <moises.cortes@notsoweb.com>
|
|
*
|
|
* @version 1.0.0
|
|
*/
|
|
class ClientUpdateRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['sometimes', 'string', 'max:255'],
|
|
'paternal' => ['sometimes', 'string', 'max:100'],
|
|
'maternal' => ['sometimes', 'string', 'max:100'],
|
|
'email' => ['sometimes', 'email'],
|
|
'phone' => ['nullable', 'string', 'max:20'],
|
|
'rfc' => ['sometimes', 'string', 'max:13'],
|
|
];
|
|
}
|
|
|
|
public function messages() : array
|
|
{
|
|
return [
|
|
'name.required' => 'El campo Nombre es obligatorio.',
|
|
'email.required' => 'El campo Correo Electrónico es obligatorio.',
|
|
'email.email' => 'El campo Correo Electrónico debe ser una dirección de correo válida.',
|
|
'phone.required' => 'El campo Teléfono es obligatorio.',
|
|
];
|
|
}
|
|
}
|