Skip to content

Commit 1ced75b

Browse files
committed
seed products
1 parent 306cfc7 commit 1ced75b

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

database/seeders/DummyData/DummyDataSeeder.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Database\Seeders\DummyData;
44

5+
use App\Models\ProductCategory;
56
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
67
use Illuminate\Database\Seeder;
78

@@ -13,9 +14,11 @@ class DummyDataSeeder extends Seeder
1314
public function run(): void
1415
{
1516
$this->call([
16-
CarProductCategorySeeder::class,
17-
CarProductSeeder::class,
17+
// CarProductCategorySeeder::class,
18+
// CarProductSeeder::class,
1819
ProductCollectionSeeder::class,
20+
ProductCategorySeeder::class,
21+
ProductSeeder::class,
1922
]);
2023
}
2124
}

database/seeders/DummyData/ProductCategorySeeder.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class ProductCategorySeeder extends Seeder
1313
*/
1414
public function run(): void
1515
{
16-
ProductCategory::create(['name' => 'Electronics', 'description' => 'Gadgets, devices, and home appliances.']);
17-
ProductCategory::create(['name' => 'Clothing', 'description' => 'Men’s, women’s, and kids’ fashion.']);
18-
ProductCategory::create(['name' => 'Books', 'description' => 'Fiction, non-fiction, and educational books.']);
19-
ProductCategory::create(['name' => 'Home & Kitchen', 'description' => 'Furniture, kitchen appliances, and decor.']);
20-
ProductCategory::create(['name' => 'Sports & Outdoors', 'description' => 'Sporting goods and outdoor equipment.']);
21-
ProductCategory::create(['name' => 'Health & Beauty', 'description' => 'Skincare, fitness equipment, and more.']);
22-
ProductCategory::create(['name' => 'Toys & Games', 'description' => 'Kids toys, video games, and board games.']);
16+
ProductCategory::factory()->create(['name' => 'Electronics', 'description' => 'Gadgets, devices, and home appliances.']);
17+
ProductCategory::factory()->create(['name' => 'Clothing', 'description' => 'Men’s, women’s, and kids’ fashion.']);
18+
ProductCategory::factory()->create(['name' => 'Books', 'description' => 'Fiction, non-fiction, and educational books.']);
19+
ProductCategory::factory()->create(['name' => 'Home & Kitchen', 'description' => 'Furniture, kitchen appliances, and decor.']);
20+
ProductCategory::factory()->create(['name' => 'Sports & Outdoors', 'description' => 'Sporting goods and outdoor equipment.']);
21+
ProductCategory::factory()->create(['name' => 'Health & Beauty', 'description' => 'Skincare, fitness equipment, and more.']);
22+
ProductCategory::factory()->create(['name' => 'Toys & Games', 'description' => 'Kids toys, video games, and board games.']);
2323

2424
}
2525
}

0 commit comments

Comments
 (0)