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,