From 2d09d1870203a9ba26e08ab3f745782272bf3c6f Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 11 May 2024 15:58:22 -0500 Subject: [PATCH] Update ShowPlanes.php --- app/Http/Livewire/ShowPlanes.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index ae7d1e7..4d66dcf 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -308,9 +308,15 @@ class ShowPlanes extends Component public function noRenovar() { // Corrección 1: Calcula la diferencia de días directamente + if (is_string($this->fecha_inicial_renovar)) { + $this->fecha_inicial_renovar = \Carbon\Carbon::createFromFormat('Y-m-d', $this->fecha_inicial_renovar); + } + + // Ahora puedes calcular la diferencia en días $this->tiempo_usuario = $this->fecha_inicial_renovar->diffInDays($this->fecha_inicial_renovar); $id = $this->id_cuentaVer; + dd('llegue'); // Corrección 2: Verifica que la cuenta exista antes de intentar actualizarla $cuenta = Cuentas::find($id); if ($cuenta) {