diff --git a/app/Http/Livewire/ShowClientes.php b/app/Http/Livewire/ShowClientes.php index ec3a500..1b39ce9 100644 --- a/app/Http/Livewire/ShowClientes.php +++ b/app/Http/Livewire/ShowClientes.php @@ -265,7 +265,6 @@ class ShowClientes extends Component public function renovar($id) { - $historiale = Historiale::with('tarifa')->find($id); @@ -280,11 +279,12 @@ class ShowClientes extends Component $historiale->fecha_final = $newFechaFinal; $historiale->save(); + $user = Auth::user(); + $user->saldo->valor -= $historiale->tarifa->valor; + $user->saldo->save(); + $this->alert('success', 'Registro renovado con éxito. Nuevas fechas aplicadas.', [ 'position' => 'top' ]); } - public function saldoSuficiente() - { - } }