78 lines
3.2 KiB
PHP
78 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Repuve;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class VehicleUpdateRequest extends FormRequest
|
|
{
|
|
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
// --- DATOS DEL VEHÍCULO ---
|
|
'vehicle.placa' => 'nullable|string|max:20',
|
|
'vehicle.marca' => 'nullable|string|max:100',
|
|
'vehicle.linea' => 'nullable|string|max:100',
|
|
'vehicle.sublinea' => 'nullable|string|max:100',
|
|
'vehicle.modelo' => 'nullable|string',
|
|
'vehicle.color' => 'nullable|string|max:50',
|
|
'vehicle.numero_motor' => 'nullable|string|max:50',
|
|
'vehicle.clase_veh' => 'nullable|string|max:50',
|
|
'vehicle.tipo_servicio' => 'nullable|string|max:50',
|
|
'vehicle.rfv' => 'nullable|string|max:50',
|
|
'vehicle.rfc' => 'nullable|string|max:13',
|
|
'vehicle.ofcexpedicion' => 'nullable|string|max:100',
|
|
'vehicle.fechaexpedicion' => 'nullable|date',
|
|
'vehicle.tipo_veh' => 'nullable|string|max:50',
|
|
'vehicle.numptas' => 'nullable|string',
|
|
'vehicle.observac' => 'nullable|string|max:500',
|
|
'vehicle.cve_vehi' => 'nullable|string|max:50',
|
|
'vehicle.nrpv' => 'nullable|string|max:50',
|
|
'vehicle.tipo_mov' => 'nullable|string|max:50',
|
|
|
|
// --- DATOS DEL PROPIETARIO ---
|
|
'owner.name' => 'nullable|string|max:100',
|
|
'owner.paternal' => 'nullable|string|max:100',
|
|
'owner.maternal' => 'nullable|string|max:100',
|
|
'owner.rfc' => 'nullable|string|max:13',
|
|
'owner.curp' => 'nullable|string|max:18',
|
|
'owner.address' => 'nullable|string|max:255',
|
|
'owner.tipopers' => 'nullable|boolean',
|
|
'owner.pasaporte' => 'nullable|string|max:20',
|
|
'owner.licencia' => 'nullable|string|max:20',
|
|
'owner.ent_fed' => 'nullable|string|max:50',
|
|
'owner.munic' => 'nullable|string|max:100',
|
|
'owner.callep' => 'nullable|string|max:100',
|
|
'owner.num_ext' => 'nullable|string|max:10',
|
|
'owner.num_int' => 'nullable|string|max:10',
|
|
'owner.colonia' => 'nullable|string|max:100',
|
|
'owner.cp' => 'nullable|string|max:5',
|
|
'owner.telefono' => 'nullable|string|max:15',
|
|
|
|
// --- ARCHIVOS ---
|
|
'files' => 'nullable|array|min:1',
|
|
'files.*' => 'file|mimes:jpeg,png,jpg|max:2048',
|
|
'name_id' => 'nullable|array',
|
|
'name_id.*' => 'integer|exists:catalog_name_img,id',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'vehicle.modelo.string' => 'El modelo debe ser texto',
|
|
'vehicle.numptas.string' => 'El número de puertas debe ser texto',
|
|
'owner.tipopers.boolean' => 'El tipo de persona debe ser física o Moral',
|
|
'owner.cp.max' => 'El código postal debe tener máximo 5 caracteres',
|
|
'files.*.mimes' => 'Solo se permiten archivos JPG, PNG o JPEG',
|
|
'files.*.max' => 'El archivo no debe superar 2MB',
|
|
];
|
|
}
|
|
}
|