This commit is contained in:
baodev0
2026-07-06 08:00:23 +07:00
parent 3bb59feba3
commit 9a16a5c313
9 changed files with 782 additions and 0 deletions
+3
View File
@@ -7,6 +7,7 @@ enum AddonType: string
case VPS = 'vps';
case HOSTING = 'hosting';
case DOMAIN = 'domain';
case WEB_DESIGN = 'web_design';
public function label(): string
{
@@ -14,6 +15,7 @@ enum AddonType: string
self::VPS => 'VPS',
self::HOSTING => 'Hosting',
self::DOMAIN => 'Domain',
self::WEB_DESIGN => 'Web Design',
};
}
@@ -23,6 +25,7 @@ enum AddonType: string
self::VPS->value => self::VPS->label(),
self::HOSTING->value => self::HOSTING->label(),
self::DOMAIN->value => self::DOMAIN->label(),
self::WEB_DESIGN->value => self::WEB_DESIGN->label(),
];
}
+71
View File
@@ -0,0 +1,71 @@
<?php
namespace App\Enums\WebDesign;
enum WebDesignPlatform: string
{
case WORDPRESS_ELEMENTOR = 'wordpress_elementor';
case WORDPRESS_HEADLESS = 'wordpress_headless';
case LARAVEL = 'laravel';
case NESTJS = 'nestjs';
case SPRING_BOOT = 'spring_boot';
public function label(): string
{
return match ($this) {
self::WORDPRESS_ELEMENTOR => 'WordPress + Elementor',
self::WORDPRESS_HEADLESS => 'WordPress Headless',
self::LARAVEL => 'Laravel',
self::NESTJS => 'NestJS',
self::SPRING_BOOT => 'Spring Boot',
};
}
/**
* Các framework frontend cho phép theo từng nền tảng.
* Mảng rỗng = không có lựa chọn frontend riêng.
*/
public function frontendOptions(): array
{
return match ($this) {
self::WORDPRESS_ELEMENTOR => [],
self::WORDPRESS_HEADLESS => ['nextjs', 'astro', 'vue', 'react', 'nuxt', 'angular'],
self::LARAVEL, self::NESTJS => ['react', 'nextjs', 'nuxt', 'vue'],
self::SPRING_BOOT => ['react', 'nextjs', 'nuxt', 'vue', 'angular'],
};
}
public function defaultFrontend(): ?string
{
return match ($this) {
self::WORDPRESS_ELEMENTOR => null,
self::WORDPRESS_HEADLESS => 'nextjs',
self::LARAVEL, self::NESTJS => 'react',
self::SPRING_BOOT => 'react',
};
}
/**
* Từ gói Laravel trở lên có thể custom admin.
*/
public function supportsCustomAdmin(): bool
{
return match ($this) {
self::WORDPRESS_ELEMENTOR, self::WORDPRESS_HEADLESS => false,
self::LARAVEL, self::NESTJS, self::SPRING_BOOT => true,
};
}
/**
* Phụ phí bản quyền hằng năm theo USD (Elementor Pro).
*/
public function annualLicenseFeeUsd(): int
{
return $this === self::WORDPRESS_ELEMENTOR ? 60 : 0;
}
public static function values(): array
{
return array_column(self::cases(), 'value');
}
}
@@ -0,0 +1,26 @@
<?php
namespace App\Enums\WebDesign;
enum WebDesignQuoteStatus: string
{
case DRAFT = 'draft';
case SENT = 'sent';
case ACCEPTED = 'accepted';
case REJECTED = 'rejected';
public function label(): string
{
return match ($this) {
self::DRAFT => 'Nháp',
self::SENT => 'Đã gửi khách',
self::ACCEPTED => 'Khách đồng ý',
self::REJECTED => 'Khách từ chối',
};
}
public static function values(): array
{
return array_column(self::cases(), 'value');
}
}