feat: Add IT Support catalog and related migrations, seeders, and email templates

- 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.
This commit is contained in:
baodev0
2026-08-26 16:19:38 +07:00
parent 382b7c0ef8
commit c917e3bf5e
47 changed files with 2992 additions and 1759 deletions
@@ -0,0 +1,20 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
private const OLD_ENUM = "ENUM('vps', 'hosting', 'cloud', 'email', 'ssl', 'domain', 'web_design', 'addon')";
private const NEW_ENUM = "ENUM('vps', 'hosting', 'cloud', 'email', 'ssl', 'domain', 'web_design', 'addon', 'hardware', 'it_support', 'server_rental')";
public function up(): void
{
DB::statement('ALTER TABLE product_categories MODIFY type ' . self::NEW_ENUM . ' NULL');
}
public function down(): void
{
DB::statement('ALTER TABLE product_categories MODIFY type ' . self::OLD_ENUM . ' NULL');
}
};
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('product_type_fields', function (Blueprint $table) {
$table->id();
$table->string('product_type', 50)->index();
$table->string('key');
$table->string('label');
$table->string('field_type', 20)->default('text')
->comment('text | number | textarea | repeater');
$table->integer('sort_order')->default(0);
$table->boolean('is_required')->default(false);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('product_type_fields');
}
};
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('products', function (Blueprint $table) {
$table->integer('domain_count')->nullable()->after('bandwidth')
->comment('Số lượng domain đi kèm gói hosting');
});
}
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->dropColumn('domain_count');
});
}
};
@@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('product_type_fields', function (Blueprint $table) {
$table->string('group_label')->nullable()->after('product_type')
->comment('Tên nhóm để gom các field liên quan khi hiển thị, vd "Bảo mật"');
});
}
public function down(): void
{
Schema::table('product_type_fields', function (Blueprint $table) {
$table->dropColumn('group_label');
});
}
};