Display stock in product info in price table.

This commit is contained in:
Krzysztof Płaczek
2024-11-17 16:38:22 +01:00
parent 48ee68f71a
commit f963dcd4c8
6 changed files with 20 additions and 7 deletions

View File

@@ -51,7 +51,6 @@ class Migrate extends Command
$table->string('name');
$table->integer('skuID')->unique();
$table->integer('availableQuantity');
$table->integer('stock');
$table->json('categories');
$table->string('image');
$table->string('subTitle');

View File

@@ -69,7 +69,7 @@ class ScrapeWebsite extends Command
$products = array_merge($products, $responseObject->products);
$page++;
$canLoadMore = $responseObject->canLoadMore;
} catch (GuzzleException $e) {
} catch (GuzzleException) {
return $products;
}
} while ($canLoadMore);
@@ -81,12 +81,10 @@ class ScrapeWebsite extends Command
{
/** @var Product $productModel */
$productModel = Product::firstOrNew(['skuID' => $product->skuID]);
//dd($productModel);
$productModel->skuID = $product->skuID;
$productModel->name = $product->name;
$productModel->availableQuantity = $product->availableQuantity;
$productModel->stock = $product->stock;
$productModel->categories = $product->categories;
$productModel->image = $product->image;
$productModel->subTitle = $product->subTitle;