diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 3a08c6f..9d84006 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -204,8 +204,6 @@ class ShowPlanes extends Component } public function openRenovar() { - $this->renovar = true; - $id = $this->id_cuentaVer; $renovarCuenta = Cuentas::findOrFail($id); @@ -217,14 +215,16 @@ class ShowPlanes extends Component $this->fecha_final_renovar_old = $renovarCuenta->vencimiento; $this->fecha_final_renovar = $renovarCuenta->vencimiento; $this->estado = $renovarCuenta->estado; + + $this->renovar = true; } public function calcularFechas() { - $this->fecha_inicial_renovar = Carbon::now()->format('Y-m-d'); - $this->fecha_final_renovar = Carbon::now()->addDays(30)->format('Y-m-d'); + $this->fecha_final_renovar = Carbon::parse($this->fecha_final_renovar)->addDays(30)->format('Y-m-d'); } + public function getListeners() { return [ @@ -277,7 +277,7 @@ class ShowPlanes extends Component { $id = $this->id_cuentaVer; - $historial = Historial_cuenta::where('cuenta_id', $id)->first(); + $historial = Historial_cuenta::where('cuenta_id', $id)->get(); Historiale::where('id', $historial->historiale_id)->update([ 'fecha_final' => date('Y-m-d', strtotime(strval($this->fecha_final_renovar))), diff --git a/resources/views/livewire/show-planes.blade.php b/resources/views/livewire/show-planes.blade.php index 4ba392f..8f767eb 100755 --- a/resources/views/livewire/show-planes.blade.php +++ b/resources/views/livewire/show-planes.blade.php @@ -332,19 +332,17 @@ @endif -