From 7bfc1450019faacc91002ee7cff6c1027bc43487 Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 11 May 2024 18:37:03 -0500 Subject: [PATCH] Update ShowPlanes.php --- app/Http/Livewire/ShowPlanes.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 79d41aa..453ebad 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -279,7 +279,12 @@ class ShowPlanes extends Component { $id = $this->id_cuentaVer; - $historial = Historial_cuenta::where('cuenta_id', $id)->get(); + $historiales = Historial_cuenta::where('cuenta_id', $id)->get(); + + foreach ($historiales as $historial) { + $historial->delete(); + } + $cuenta_renovar = Cuentas::find($id); @@ -291,7 +296,7 @@ class ShowPlanes extends Component 'estado' => $this->estado, ]); - $historial->delete(); + Log_historial::create([ 'user_id' => Auth::user()->id,