01 2022 Microsite Promotion

This commit is contained in:
Kevin Adametz 2022-01-18 18:30:14 +01:00
parent 3f1fb9377d
commit 38e7fd504a
39 changed files with 761 additions and 336 deletions

View file

@ -159,7 +159,18 @@ class ProductRepository extends BaseRepository {
'attribute_id' => $attribute->attribute_id,
]);
}
//INCS
$ingredients = $model->p_ingredients()->pluck('ingredient_id')->toArray();
if(is_array($ingredients)){
foreach ($ingredients as $incs_id){
ProductIngredient::create([
'product_id' => $this->model->id,
'ingredient_id' => $incs_id,
]);
}
}
//images
foreach ($model->images as $image){
$name = \App\Services\Slim::sanitizeFileName($image->original_name);