add: incluir campo de código de barras en la creación y actualización de productos
This commit is contained in:
parent
388ba3eff2
commit
06425157b8
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user