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
@@ -38,6 +38,7 @@ class ServiceResource extends JsonResource
'description' => $this->description,
'thumbnail' => $this->thumbnail ? asset($this->thumbnail) : null,
'product_type' => $this->product_type,
'page_type' => $this->resolvePageType($this->product_type),
'specs' => [
'cpu' => (int) $this->cpu,
'ram' => (int) $this->ram,
@@ -77,4 +78,15 @@ class ServiceResource extends JsonResource
]),
];
}
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',
};
}
}