diff --git a/backend/app/Http/Controllers/ProductController.php b/backend/app/Http/Controllers/ProductController.php index c003c10..635c1cd 100644 --- a/backend/app/Http/Controllers/ProductController.php +++ b/backend/app/Http/Controllers/ProductController.php @@ -27,7 +27,10 @@ public function store(CreateProductRequest $request) public function show(string $slug) { - $product = Product::where('slug', $slug)->with(['category:id,name,slug', 'images:id,path,product_id'])->firstOrFail(); + $product = Product::where('slug', $slug) + ->with(['category:id,name,slug', 'images:id,path,product_id']) + ->withExists('favoritedBy') + ->firstOrFail(); return new ProductResource(ProductDTO::fromModel($product)); }