diff --git a/packages/Sarga/Shop/src/Repositories/ProductRepository.php b/packages/Sarga/Shop/src/Repositories/ProductRepository.php index 0d5ef224b..7e809344d 100644 --- a/packages/Sarga/Shop/src/Repositories/ProductRepository.php +++ b/packages/Sarga/Shop/src/Repositories/ProductRepository.php @@ -571,9 +571,10 @@ class ProductRepository extends WProductRepository $brand = $this->brandRepository->firstOrCreate([ 'name' => $brand_name ]); - - $brand->products()->attach($product); - $brand->save(); + $product->brand()->associate($brand); + $product->save(); +// $brand->products()->attach($product); +// $brand->save(); } private function assignImages($product,$images){