From 2daa9ee98ffad9c7c5c9fb11d05f9280e4548bb4 Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Tue, 6 Jan 2026 12:53:38 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20arco=20creaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/VehicleService.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Services/VehicleService.php b/app/Services/VehicleService.php index 0a24520..ad71698 100644 --- a/app/Services/VehicleService.php +++ b/app/Services/VehicleService.php @@ -20,8 +20,14 @@ public function procesarDeteccion(string $epc, string $fastId, string $arcoIp, ? $key = "vehiculo:robado:{$epc}"; // Buscar o crear arco por IP - $arco = Arco::buscarPorIp($arcoIp); - $arcoId = $arco?->id; + $arco = Arco::firstOrCreate( + ['ip_address' => $arcoIp], + [ + 'nombre' => 'Arco ' . $arcoIp, + 'activo' => true + ] + ); + $arcoId = $arco->id; // Verificar si está en Redis $enRedis = Redis::get($key);