This commit is contained in:
merdan 2022-04-07 15:06:32 +05:00
parent 44a3cde96a
commit 0ac9ce83b6
1 changed files with 3 additions and 3 deletions

View File

@ -567,12 +567,12 @@ class ProductRepository extends WProductRepository
return $sellerProduct;
}
private function assignBrand($product, $brand){
private function assignBrand($product, $brand_name){
$brand = $this->brandRepository->firstOrCreate([
'name' => $brand
'name' => $brand_name
]);
$brand->products()->associate($product);
$brand->products()->attach($product);
$brand->save();
}