ldc-doux/database/seeders/GammesSeeder.php
2026-10-27 09:12:51 +01:00

389 lines
17 KiB
PHP

<?php
namespace Database\Seeders;
use App\Lib\Utils;
use App\Models\Gamme;
use App\Models\Product;
use Illuminate\Database\Seeder;
use SplFileInfo;
use Illuminate\Support\Str;
class GammesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$tabFour = [
'id' => 0,
'name' => 'Four',
'url' => '/assets/images/four.png',
'time' => '1h30mins.',
'temp' => '200°C',
'status' => true
];
$tabFriteuse = [
'id' => 1,
'name' => 'Friteuse',
'url' => '/assets/images/friteuse.png',
'time' => '15 minutes',
'temp' => '100°C',
'status' => true
];
$tabPoele = [
'id' => 2,
'name' => 'Poêle',
'url' => '/assets/images/poele.png',
'time' => '5 minutes sur chaque face',
'temp' => '101°C',
'status' => true
];
$tabCocotte = [
'id' => 3,
'name' => 'Cocotte',
'url' => '/assets/images/cocotte.png',
'time' => '3 h',
'temp' => '80°C',
'status' => false
];
$tabPlancha = [
'id' => 4,
'name' => 'Plancha',
'url' => '/assets/images/plancha.png',
'time' => '20mins',
'temp' => '130°C',
'status' => false
];
$tabBainMarie = [
'id' => 5,
'name' => 'Bain Marie',
'url' => '/assets/images/bainmarie.png',
'time' => '30 mins à 45 mins',
'temp' => '80°C',
'status' => false
];
$tabBarbecue = [
'id' => 6,
'name' => 'Barbecue',
'url' => '/assets/images/barbecue.png',
'time' => '30 minutes',
'temp' => '200°C',
'status' => false
];
$tabMicroOndes = [
'id' => 7,
'name' => 'Micro Ondes',
'url' => '/assets/images/microondes.png',
'time' => '3mins',
'temp' => '900 Watts',
'status' => false
];
$tabCasserole = [
'id' => 8,
'name' => 'Casserole',
'url' => '/assets/images/casserole.png',
'time' => '10mins',
'temp' => '90°C',
'status' => false
];
$tabPlusProduit1 = [
'id' => 0,
'name' => 'Lorem ipsum set doloris',
'url' => '/assets/images/sans-label.jpg',
];
$tabPlusProduit2 = [
'id' => 1,
'name' => 'Lorem ipsum set doloris',
'url' => '/assets/images/sans-label.jpg',
];
$tabPlusProduit3 = [
'id' => 2,
'name' => 'Lorem ipsum set doloris',
'url' => '/assets/images/sans-label.jpg',
];
$gamme = new Gamme();
$gamme->parent_gamme_id = null;
$gamme->title = 'Chicken Franks';
$gamme->slug = Str::slug($gamme->title);
$gamme->text = 'Classiques ou Mini, faites votre choix';
$gamme->color = '#ffa589';
$upload = new SplFileInfo(resource_path('seeds/gammes/chicken-franks.jpg'));
$imgpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->picture = $imgpath;
$gamme->alt_text_picture = $gamme->title;
$upload = new SplFileInfo(resource_path('seeds/gammes/entete_chicken-franks.jpg'));
$bannerpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->banner = $bannerpath;
$gamme->alt_text_banner = $gamme->title;
$gamme->save();
$gameParent = $gamme->id;
$gamme = new Gamme();
$gamme->parent_gamme_id = $gameParent;
$gamme->title = 'Les classiques';
$gamme->slug = Str::slug($gamme->title);
// phpcs:ignore Generic.Files.LineLength.TooLong
$gamme->text = 'Idéales pour toute la famille, les Chicken Franks classiques sont faciles et rapides à cuisiner. Faites votre choix parmi la multitude de saveurs disponibles.';
$gamme->color = '#000000';
$upload = new SplFileInfo(resource_path('seeds/gammes/88853_1.jpg'));
$imgpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->picture = $imgpath;
$gamme->alt_text_picture = $gamme->title;
$upload = new SplFileInfo(resource_path('seeds/gammes/entete_chicken-franks.jpg'));
$bannerpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->banner = $bannerpath;
$gamme->alt_text_banner = $gamme->title;
$gamme->save();
$tabPlusProduit1 = [
'id' => 0,
'name' => 'Multiplier les recettes avec ce produit : plats mijotés, hot dog, salades...',
'url' => '/assets/images/sans-label.jpg',
];
$tabPlusProduit2 = [
'id' => 1,
'name' => 'Une recette garantie sans colorant',
'url' => '/assets/images/sans-label.jpg',
];
$product = new Product();
$product->gamme_id = $gamme->id;
$product->name = 'Chicken Franks Original';
$product->slug = Str::slug($product->name);
// phpcs:ignore Generic.Files.LineLength.TooLong
$product->description = 'Les Franks de poulet original : un goût unique et qui s\'accordera facilement à tous vos plats. Elles sont congelées directement après leur production afin de garantir une qualité et un goût optimal.';
$upload = new SplFileInfo(resource_path('seeds/products/88891_2.png'));
$imgpath = Utils::storeImage($upload, $product->getTable());
$product->picture = $imgpath;
$product->alt_text_picture = $product->name;
$product->pictos = '';
$product->plusproduit = json_encode([$tabPlusProduit1, $tabPlusProduit2]);
$product->is_published = true;
$product->is_on_top = random_int(true, false);
$product->is_news = random_int(true, false);
$product->is_food_service = random_int(true, false);
$product->is_halal = random_int(true, false);
$product->seo_title = 'Chicken franks, poulet, recettes, qualité';
$product->seo_description = 'Doux vous propose des Chicken Franks Original préparées en France';
$product->save();
$gamme = new Gamme();
$gamme->parent_gamme_id = $gameParent;
$gamme->title = 'Les mini';
$gamme->slug = Str::slug($gamme->title);
// phpcs:ignore Generic.Files.LineLength.TooLong
$gamme->text = 'Rapide et pratique à réchauffer, ce format est idéal pour les moments de partage et les repas sur le pouce.';
$gamme->color = '#c0d8e0';
$upload = new SplFileInfo(resource_path('seeds/gammes/132505_1.jpg'));
$imgpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->picture = $imgpath;
$gamme->alt_text_picture = $gamme->title;
$upload = new SplFileInfo(resource_path('seeds/gammes/entete-minis.jpg'));
$bannerpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->banner = $bannerpath;
$gamme->alt_text_banner = $gamme->title;
$gamme->save();
$tabMicroOndes = [
'id' => 0,
'name' => 'Micro Ondes',
'url' => '/assets/images/micro-onde.png',
'time' => '3mins',
'temp' => '900 Watts',
'status' => true
];
$tabCasserole = [
'id' => 1,
'name' => 'Casserole',
'url' => '/assets/images/casserole.png',
'time' => '5mins',
'temp' => 'Au bain marie',
'status' => true
];
$tabPlusProduit1 = [
'id' => 0,
'name' => 'La gourmandise à emporter partout !',
'url' => '/assets/images/sans-label.jpg',
];
$tabPlusProduit2 = [
'id' => 1,
'name' => 'Le goût fromage, le petit plus qui fait qu\'on l\'adore',
'url' => '/assets/images/sans-label.jpg',
];
$product = new Product();
$product->gamme_id = $gamme->id;
$product->name = 'Mini Chicken Franks Cheese';
$product->slug = Str::slug($product->name);
// phpcs:ignore Generic.Files.LineLength.TooLong
$product->description = 'Les Mini Chicken Franks cheese... avec elles, plus besoin de se priver pour se faire plaisir à tout moment de la journée';
$upload = new SplFileInfo(resource_path('seeds/products/132505_2.png'));
$imgpath = Utils::storeImage($upload, $product->getTable());
$product->picture = $imgpath;
$product->alt_text_picture = $product->name;
$product->pictos = json_encode([
'microondes' => $tabMicroOndes,
'casserole' => $tabCasserole
]);
$product->plusproduit = json_encode([$tabPlusProduit1, $tabPlusProduit2]);
$product->is_published = true;
$product->is_on_top = random_int(true, false);
$product->is_news = random_int(true, false);
$product->is_food_service = random_int(true, false);
$product->is_halal = random_int(true, false);
$product->seo_title = 'recette, qualité, Chicken franks, plaisir, gourmandise';
$product->seo_description = 'Doux vous propose des Mini Chicken Franks Cheese préparées en France';
$product->save();
$product = new Product();
$product->gamme_id = $gamme->id;
$product->name = 'Mini Chicken Franks Original';
$product->slug = Str::slug($product->name);
// phpcs:ignore Generic.Files.LineLength.TooLong
$product->description = 'Les Mini Chicken Franks original, c\'est votre recette de Franks préférée en plus petit ! De quoi vous faire craquer !';
$upload = new SplFileInfo(resource_path('seeds/products/132504_2.png'));
$imgpath = Utils::storeImage($upload, $product->getTable());
$product->picture = $imgpath;
$product->alt_text_picture = $product->name;
$product->pictos = json_encode([
'four' => $tabFour,
'friteuse' => $tabFriteuse,
'poele' => $tabPoele,
'cocotte' => $tabCocotte,
'plancha' => $tabPlancha,
'bainmarie' => $tabBainMarie,
'barbecue' => $tabBarbecue,
'microondes' => $tabMicroOndes
]);
$product->plusproduit = json_encode([$tabPlusProduit1, $tabPlusProduit2, $tabPlusProduit3]);
$product->is_published = true;
$product->is_on_top = random_int(true, false);
$product->is_news = random_int(true, false);
$product->is_food_service = random_int(true, false);
$product->is_halal = random_int(true, false);
$product->seo_title = 'recette, qualité, Chicken franks, plaisir, gourmandise';
$product->seo_description = 'Doux vous propose des Mini Chicken Franks Cheese préparées en France';
$product->save();
$gamme = new Gamme();
$gamme->parent_gamme_id = null;
$gamme->title = 'Prêts à cuire';
$gamme->slug = Str::slug($gamme->title);
$gamme->text = 'Steak haché de poulet façon bouchère, l\'innovation à marque Doux';
$gamme->color = '#8fd5a6';
$upload = new SplFileInfo(resource_path('seeds/gammes/131700_1.jpg'));
$imgpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->picture = $imgpath;
$gamme->alt_text_picture = $gamme->title;
$upload = new SplFileInfo(resource_path('seeds/gammes/entete-pret-a-cuire.jpg'));
$bannerpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->banner = $bannerpath;
$gamme->alt_text_banner = $gamme->title;
$gamme->save();
$tabPoele = [
'id' => 0,
'name' => 'Poêle',
'url' => '/assets/images/poele.png',
'time' => '10mins',
'temp' => '',
'status' => true
];
$tabPlusProduit1 = [
'id' => 0,
'name' => 'Un hachage façon bouchère pour un goût et une texture exceptionnelle !',
'url' => '/assets/images/sans-label.jpg',
];
$tabPlusProduit2 = [
'id' => 1,
'name' => '100% cuisse, 100% qualité',
'url' => '/assets/images/sans-label.jpg',
];
$tabPlusProduit3 = [
'id' => 2,
'name' => 'Une recette sans colorant, sans exhausteur de goût et sans conservateur',
'url' => '/assets/images/sans-label.jpg',
];
$product = new Product();
$product->gamme_id = $gamme->id;
$product->name = 'Steak haché de poulet';
$product->slug = Str::slug($product->name);
// phpcs:ignore Generic.Files.LineLength.TooLong
$product->description = 'Un steak haché de poulet façon bouchère avec un large grain. De la viande de qualité issue de la cuisse. Rien de plus, rien de moins.';
$upload = new SplFileInfo(resource_path('seeds/products/131700_1.png'));
$imgpath = Utils::storeImage($upload, $product->getTable());
$product->picture = $imgpath;
// phpcs:ignore Generic.Files.LineLength.TooLong
$product->alt_text_picture = 'Un produit incontournable du rayon surgelé maintenant disponible au rayon poulet.';
$product->pictos = json_encode(['poele' => $tabPoele]);
$product->plusproduit = json_encode([$tabPlusProduit1, $tabPlusProduit2, $tabPlusProduit3]);
$product->is_published = true;
$product->is_on_top = random_int(true, false);
$product->is_news = random_int(true, false);
$product->is_food_service = random_int(true, false);
$product->is_halal = random_int(true, false);
$product->seo_title = 'recette, qualité, viande, cuisse, steak haché, poulet';
$product->seo_description = 'Doux vous propose un Steak haché de poulet préparé en France';
$product->save();
$gamme = new Gamme();
$gamme->title = 'Volailles entières';
$gamme->slug = Str::slug($gamme->title);
// phpcs:ignore Generic.Files.LineLength.TooLong
$gamme->text = 'Découvrez la gamme historique de Doux. Des volailles entières, nées, élevées et préparées en France, nourries exclusivement avec des végétaux, des minéraux et des vitamines.';
$gamme->color = '#d4eac8';
$upload = new SplFileInfo(resource_path('seeds/gammes/gamme_volaille.jpg'));
$imgpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->picture = $imgpath;
$gamme->alt_text_picture = $gamme->title;
$upload = new SplFileInfo(resource_path('seeds/gammes/entete-volaille.jpg'));
$bannerpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->banner = $bannerpath;
$gamme->alt_text_banner = $gamme->title;
$gamme->save();
$tabPlusProduit1 = [
'id' => 0,
'name' => 'Volailles nourries exclusivement avec des végétaux, des minéraux et des vitamines',
'url' => '/assets/images/sans-label.jpg',
];
$product = new Product();
$product->gamme_id = $gamme->id;
$product->name = 'Poulet sans abats';
$product->slug = Str::slug($product->name);
// phpcs:ignore Generic.Files.LineLength.TooLong
$product->description = 'Le poulet Doux est congelé dans les 24h après l\'abattage pour garantir ses qualités nutritionnelles et gustatives. Un produit historique qui a fait la réputation de la marque et qui vous satisfait depuis près de 90 ans !';
$upload = new SplFileInfo(resource_path('seeds/products/89779_1.png'));
$imgpath = Utils::storeImage($upload, $product->getTable());
$product->picture = $imgpath;
$product->alt_text_picture = $product->name;
$product->pictos = '';
$product->plusproduit = json_encode([$tabPlusProduit1]);
$product->is_published = true;
$product->is_on_top = random_int(true, false);
$product->is_news = random_int(true, false);
$product->is_food_service = random_int(true, false);
$product->is_halal = random_int(true, false);
$product->seo_title = 'volaille, poulet, Doux, qualités';
$product->seo_description = 'Doux vous propose des Poulets entiers congelés, nés, élevés et préparés en France';
$product->save();
$gamme = new Gamme();
$gamme->title = 'Food Service';
$gamme->slug = Str::slug($gamme->title);
$gamme->text = 'Food Service';
$gamme->color = '#d4eac8';
$upload = new SplFileInfo(resource_path('seeds/gammes/gamme_volaille.jpg'));
$imgpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->picture = $imgpath;
$gamme->alt_text_picture = $gamme->title;
$upload = new SplFileInfo(resource_path('seeds/gammes/entete-volaille.jpg'));
$bannerpath = Utils::storeImage($upload, $gamme->getTable());
$gamme->banner = $bannerpath;
$gamme->alt_text_banner = $gamme->title;
$gamme->save();
}
}