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,