diff --git a/packages/Sarga/API/Http/Resources/Core/Vendor.php b/packages/Sarga/API/Http/Resources/Core/Vendor.php index 39bb54311..3dd6b6196 100644 --- a/packages/Sarga/API/Http/Resources/Core/Vendor.php +++ b/packages/Sarga/API/Http/Resources/Core/Vendor.php @@ -22,7 +22,7 @@ class Vendor extends JsonResource 'logo' => $this->logo_url, 'banner' => $this->banner_url, 'brand_id' => $this->brand_attribute_id, - $this->mergeWhen(!empty($this->main_categories),[ + $this->mergeWhen(!empty($this->main_categories) && $this->main_categories->count(),[ 'categories' => Category::collection($this->main_categories) ])