From a0fcde8c3eb4f13aee2917f08af45d808ac14c80 Mon Sep 17 00:00:00 2001 From: a6a2f5842 Date: Fri, 21 Nov 2025 16:11:43 +0100 Subject: [PATCH] BF shop example command --- database/factories/ProductFactory.php | 1 + src/Console/Commands/ShopAddExampleProducts.php | 1 + 2 files changed, 2 insertions(+) diff --git a/database/factories/ProductFactory.php b/database/factories/ProductFactory.php index 656e845..e5f224c 100644 --- a/database/factories/ProductFactory.php +++ b/database/factories/ProductFactory.php @@ -15,6 +15,7 @@ class ProductFactory extends Factory $name = $this->faker->words(3, true); return [ + 'name' => ucfirst($name), 'slug' => Str::slug($name), 'sku' => strtoupper($this->faker->bothify('??-####')), 'type' => 'simple', diff --git a/src/Console/Commands/ShopAddExampleProducts.php b/src/Console/Commands/ShopAddExampleProducts.php index 8afb0d7..3eeef35 100644 --- a/src/Console/Commands/ShopAddExampleProducts.php +++ b/src/Console/Commands/ShopAddExampleProducts.php @@ -126,6 +126,7 @@ class ShopAddExampleProducts extends Command $onSale = $this->faker->boolean(30); // 30% chance of being on sale $product = Product::create([ + 'name' => $productName, 'slug' => $slug, 'sku' => 'EX-' . strtoupper($this->faker->bothify('??-####')), 'type' => $type,