From f4a8cd52dda65bea41b7a7e497be5191a2d63fdc Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 7 Apr 2022 15:10:38 +0500 Subject: [PATCH] fix mix --- packages/Sarga/Shop/src/Repositories/ProductRepository.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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){