diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 9c2b25e..4599149 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -229,6 +229,13 @@ class ShowPlanes extends Component Historial_cuenta::where('cuenta_id', $id)->delete(); + $cuenta_renovar = Cuentas::find($id); + + Log_historial::create([ + 'user_id' => Auth::user()->id, + 'detalle' => 'El usuario ha renovado la cuenta ' . $cuenta_renovar->correo + ]); + $this->alert('success', 'Cuenta renovada y liberada correctamente!', [ 'position' => 'top' ]); @@ -241,7 +248,7 @@ class ShowPlanes extends Component { $id = $this->id_cuentaVer; - Cuentas::where('id', $id)->update([ + $cuenta_renovar = Cuentas::where('id', $id)->update([ 'correo' => $this->usuario_renovar, 'password' => $this->password_renovar, 'inicio' => date('Y-m-d', strtotime(strval($this->fecha_inicial_renovar))), @@ -249,6 +256,11 @@ class ShowPlanes extends Component 'estado' => $this->estado, ]); + Log_historial::create([ + 'user_id' => Auth::user()->id, + 'detalle' => 'El usuario ha renovado la cuenta ' . $cuenta_renovar->correo + ]); + $this->alert('success', 'Cuenta renovada correctamente!', [ 'position' => 'top' ]);