Clean up documentation and infrastructure configuration files, and refine API resources and controllers for products and services.

This commit is contained in:
pbao9
2026-03-09 14:18:04 +07:00
parent 7b3c955d38
commit 80a5e0ca3d
13 changed files with 390 additions and 2656 deletions
@@ -19,6 +19,7 @@ class ProductResource extends JsonResource
'name' => $this->name,
'slug' => $this->slug,
'product_type' => $this->product_type,
'page_type' => $this->resolvePageType($this->product_type),
'category' => $this->whenLoaded('category', fn() => $this->category?->name),
'cpu' => $this->cpu,
'ram' => $this->ram,
@@ -30,4 +31,15 @@ class ProductResource extends JsonResource
'created_at' => $this->created_at,
];
}
private function resolvePageType(?string $productType): string
{
return match ($productType) {
'vps', 'cloud' => 'service_vps',
'hosting', 'email', 'ssl' => 'service_hosting',
'domain' => 'service_domain',
'blog' => 'blog',
default => 'service_vps',
};
}
}