- Created migration to add 'group_label' to 'product_type_fields' table. - Implemented ItSupportCatalogSeeder to populate IT Support features and tiers. - Added ProductCategorySeeder for initial product categories. - Developed ProductMockupSeeder for mockup products in various categories. - Introduced ProductTypeFieldSeeder to define fields for different product types. - Created email templates for VPS service information and service renewal reminders.
28 lines
979 B
PHP
28 lines
979 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\ProductCategories;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class ProductCategorySeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
$categories = [
|
|
['name' => 'Thiết kế website', 'slug' => 'thiet-ke-website', 'type' => 'web_design', 'sort_order' => 10],
|
|
['name' => 'Email', 'slug' => 'email', 'type' => 'email', 'sort_order' => 20],
|
|
['name' => 'Hardware', 'slug' => 'hardware', 'type' => 'hardware', 'sort_order' => 30],
|
|
['name' => 'IT Support', 'slug' => 'it-support', 'type' => 'it_support', 'sort_order' => 40],
|
|
['name' => 'Thuê máy chủ', 'slug' => 'thue-may-chu', 'type' => 'server_rental', 'sort_order' => 50],
|
|
];
|
|
|
|
foreach ($categories as $category) {
|
|
ProductCategories::firstOrCreate(
|
|
['slug' => $category['slug']],
|
|
$category + ['is_active' => true]
|
|
);
|
|
}
|
|
}
|
|
}
|