feat: expose category name in ProductResource

This commit is contained in:
pbao9
2026-03-09 17:31:21 +07:00
parent 8346562e1b
commit a70900f542
@@ -21,6 +21,7 @@ class ProductResource extends JsonResource
'product_type' => $this->product_type,
'page_type' => $this->resolvePageType($this->product_type),
'product_categories_id' => $this->whenLoaded('category', fn() => $this->category?->id),
'category' => $this->whenLoaded('category', fn() => $this->category?->name),
'cpu' => $this->cpu,
'ram' => $this->ram,
'disk' => $this->disk,