main screen categories and products

This commit is contained in:
merdan 2022-01-20 12:00:25 +05:00
parent 7c54b469bc
commit bf7a1df720
1 changed files with 1 additions and 1 deletions

View File

@ -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)
])