is_tasted) { ProductComment::factory(1)->make()->each(function (ProductComment $productcomment) use ($product) { $productcomment->product_id = $product->id; $productcomment->saveOrFail(); }); } $jj = $jj + 1; }); } }