BF shop example command
This commit is contained in:
parent
af4f6b9fa6
commit
a0fcde8c3e
|
|
@ -15,6 +15,7 @@ class ProductFactory extends Factory
|
||||||
$name = $this->faker->words(3, true);
|
$name = $this->faker->words(3, true);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
'name' => ucfirst($name),
|
||||||
'slug' => Str::slug($name),
|
'slug' => Str::slug($name),
|
||||||
'sku' => strtoupper($this->faker->bothify('??-####')),
|
'sku' => strtoupper($this->faker->bothify('??-####')),
|
||||||
'type' => 'simple',
|
'type' => 'simple',
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ class ShopAddExampleProducts extends Command
|
||||||
$onSale = $this->faker->boolean(30); // 30% chance of being on sale
|
$onSale = $this->faker->boolean(30); // 30% chance of being on sale
|
||||||
|
|
||||||
$product = Product::create([
|
$product = Product::create([
|
||||||
|
'name' => $productName,
|
||||||
'slug' => $slug,
|
'slug' => $slug,
|
||||||
'sku' => 'EX-' . strtoupper($this->faker->bothify('??-####')),
|
'sku' => 'EX-' . strtoupper($this->faker->bothify('??-####')),
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue