|
|
@ -74,10 +74,12 @@ class ProductSeeder extends Seeder
|
|
|
|
$plan = 6;
|
|
|
|
$plan = 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$product->categories()->sync($plans[$plan]['cats']);
|
|
|
|
$product->categories()->sync($plans[$plan]['cats']);
|
|
|
|
$num = rand(1, $plans[$plan]['max']);
|
|
|
|
if (env('PIC_SEED') != 0){
|
|
|
|
$product->addMedia($plans[$plan]['dir'] . "$num.jpg")->preservingOriginal()->toMediaCollection();
|
|
|
|
$num = rand(1, $plans[$plan]['max']);
|
|
|
|
$num = rand(1, $plans[$plan]['max']);
|
|
|
|
$product->addMedia($plans[$plan]['dir'] . "$num.jpg")->preservingOriginal()->toMediaCollection();
|
|
|
|
$product->addMedia($plans[$plan]['dir'] . "$num.jpg")->preservingOriginal()->toMediaCollection();
|
|
|
|
$num = rand(1, $plans[$plan]['max']);
|
|
|
|
|
|
|
|
$product->addMedia($plans[$plan]['dir'] . "$num.jpg")->preservingOriginal()->toMediaCollection();
|
|
|
|
|
|
|
|
}
|
|
|
|
$product->cat_id = $plans[$plan]['main'];
|
|
|
|
$product->cat_id = $plans[$plan]['main'];
|
|
|
|
$product->save();
|
|
|
|
$product->save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|