\ No newline at end of file
diff --git a/packages/Sarga/Shop/src/Models/Category.php b/packages/Sarga/Shop/src/Models/Category.php
index 232a685b3..8049920cf 100644
--- a/packages/Sarga/Shop/src/Models/Category.php
+++ b/packages/Sarga/Shop/src/Models/Category.php
@@ -54,4 +54,8 @@ class Category extends WCategory
public function brands() :BelongsToMany{
return $this->belongsToMany(BrandProxy::modelClass(),'category_brands');
}
+
+ public function vendors() :BelongsToMany{
+ return $this->belongsToMany(VendorProxy::modelClass(),'vendor_categories');
+ }
}
\ No newline at end of file
diff --git a/packages/Sarga/Shop/src/Models/Vendor.php b/packages/Sarga/Shop/src/Models/Vendor.php
index 1e6e3165f..8ab9efe5a 100644
--- a/packages/Sarga/Shop/src/Models/Vendor.php
+++ b/packages/Sarga/Shop/src/Models/Vendor.php
@@ -3,17 +3,16 @@
namespace Sarga\Shop\Models;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Sarga\Brand\Models\BrandProxy;
+use Webkul\Category\Models\CategoryProxy;
use Webkul\Marketplace\Models\Seller;
-use Webkul\Marketplace\Models\SellerCategoryProxy;
use Sarga\Shop\Contracts\Vendor as VendorContract;
class Vendor extends Seller implements VendorContract
{
- public function categories() : HasOne
+ public function categories() : BelongsToMany
{
- return $this->hasOne(SellerCategoryProxy::modelClass(),'seller_id',);
+ return $this->belongsToMany(CategoryProxy::modelClass(),'vendor_categories',);
}
public function brands() : BelongsToMany