main screen categories and products
This commit is contained in:
parent
59d32d9a78
commit
7c54b469bc
|
|
@ -43,6 +43,7 @@ class Vendors extends Controller
|
|||
->with(['children'=> function($q){
|
||||
$q->orderBy('position','asc');
|
||||
}])
|
||||
->orderBy('position','asc')
|
||||
->get();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,10 @@ class Vendor extends JsonResource
|
|||
'logo' => $this->logo_url,
|
||||
'banner' => $this->banner_url,
|
||||
'brand_id' => $this->brand_attribute_id,
|
||||
'categories' => Category::collection($this->main_categories),
|
||||
$this->mergeWhen(!empty($this->main_categories),[
|
||||
'categories' => Category::collection($this->main_categories)
|
||||
])
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue