From 06425157b84d4587d52c5cb5b02b5f770f9aada7 Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Tue, 6 Jan 2026 09:07:45 -0600 Subject: [PATCH] =?UTF-8?q?add:=20incluir=20campo=20de=20c=C3=B3digo=20de?= =?UTF-8?q?=20barras=20en=20la=20creaci=C3=B3n=20y=20actualizaci=C3=B3n=20?= =?UTF-8?q?de=20productos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ProductService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Services/ProductService.php b/app/Services/ProductService.php index 8c7572a..88e0a3b 100644 --- a/app/Services/ProductService.php +++ b/app/Services/ProductService.php @@ -12,6 +12,7 @@ public function createProduct(array $data) $inventory = Inventory::create([ 'name' => $data['name'], 'sku' => $data['sku'], + 'barcode' => $data['barcode'] ?? null, 'category_id' => $data['category_id'], 'stock' => $data['stock'] ?? 0, ]); @@ -34,6 +35,7 @@ public function updateProduct(Inventory $inventory, array $data) $inventoryData = array_filter([ 'name' => $data['name'] ?? null, 'sku' => $data['sku'] ?? null, + 'barcode' => $data['barcode'] ?? null, 'category_id' => $data['category_id'] ?? null, 'stock' => $data['stock'] ?? null, ], fn($value) => $value !== null);