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([
|
$inventory = Inventory::create([
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'sku' => $data['sku'],
|
'sku' => $data['sku'],
|
||||||
|
'barcode' => $data['barcode'] ?? null,
|
||||||
'category_id' => $data['category_id'],
|
'category_id' => $data['category_id'],
|
||||||
'stock' => $data['stock'] ?? 0,
|
'stock' => $data['stock'] ?? 0,
|
||||||
]);
|
]);
|
||||||
@ -34,6 +35,7 @@ public function updateProduct(Inventory $inventory, array $data)
|
|||||||
$inventoryData = array_filter([
|
$inventoryData = array_filter([
|
||||||
'name' => $data['name'] ?? null,
|
'name' => $data['name'] ?? null,
|
||||||
'sku' => $data['sku'] ?? null,
|
'sku' => $data['sku'] ?? null,
|
||||||
|
'barcode' => $data['barcode'] ?? null,
|
||||||
'category_id' => $data['category_id'] ?? null,
|
'category_id' => $data['category_id'] ?? null,
|
||||||
'stock' => $data['stock'] ?? null,
|
'stock' => $data['stock'] ?? null,
|
||||||
], fn($value) => $value !== null);
|
], fn($value) => $value !== null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user