refactor: ProductResource now returns product_categories_id with the category ID instead of the category name.

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