From ebd3a1658e214ef9ede5bd3e1b728d729b00acc9 Mon Sep 17 00:00:00 2001 From: Damian Date: Fri, 7 Mar 2025 13:22:51 -0600 Subject: [PATCH] Funcionalidad corregida vehiculos editar --- app/Http/Controllers/TiposVeiculosController.php | 12 ++++++------ resources/views/vehiculosCrearEditar.blade.php | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/TiposVeiculosController.php b/app/Http/Controllers/TiposVeiculosController.php index 6fdd6e6..7d018d9 100644 --- a/app/Http/Controllers/TiposVeiculosController.php +++ b/app/Http/Controllers/TiposVeiculosController.php @@ -69,8 +69,8 @@ class TiposVeiculosController extends Controller */ public function edit($id) { - $tiposVeiculos = tiposVeiculos::find($id); - return view('vehiculosCrearEditar',['tiposVeiculos'=>$tiposVeiculos]); + $tipoVehiculo = tiposVeiculos::find($id); + return view('vehiculosCrearEditar', ['tipoVehiculo' => $tipoVehiculo]); } /** @@ -78,10 +78,10 @@ class TiposVeiculosController extends Controller */ public function update(Request $request, $id) { - $tiposVeiculos = tiposVeiculos::find($id); - $tiposVeiculos->fill($request->all()); - $tiposVeiculos->save(); - return redirect()->route('vehiculos.index'); + $tipoVehiculo = tiposVeiculos::find($id); + $tipoVehiculo->fill($request->all()); + $tipoVehiculo->save(); + return redirect()->route('vehiculos.index')->with('success', 'VehĂ­culo actualizado exitosamente.'); } /** diff --git a/resources/views/vehiculosCrearEditar.blade.php b/resources/views/vehiculosCrearEditar.blade.php index 8713fef..b4aa41c 100644 --- a/resources/views/vehiculosCrearEditar.blade.php +++ b/resources/views/vehiculosCrearEditar.blade.php @@ -69,8 +69,7 @@ class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> Cancelar -