2021-12-20 17:21:09 +01:00
< ? php
namespace Database\Seeders ;
2022-01-23 15:03:05 +01:00
use App\Lib\Utils ;
2021-12-20 17:21:09 +01:00
use App\Models\Gamme ;
2021-12-22 17:32:05 +01:00
use App\Models\Product ;
2021-12-20 17:21:09 +01:00
use Illuminate\Database\Seeder ;
use SplFileInfo ;
2021-12-21 17:30:39 +01:00
use Illuminate\Support\Str ;
2021-12-20 17:21:09 +01:00
class GammesSeeder extends Seeder
{
/**
* Run the database seeds .
*
* @ return void
*/
public function run ()
{
2026-10-27 09:12:51 +01:00
$tabFour = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Four' ,
'url' => '/assets/images/four.png' ,
'time' => '1h30mins.' ,
'temp' => '200°C' ,
'status' => true
2026-10-27 09:12:51 +01:00
];
$tabFriteuse = [
2022-02-07 17:24:13 +01:00
'id' => 1 ,
'name' => 'Friteuse' ,
'url' => '/assets/images/friteuse.png' ,
'time' => '15 minutes' ,
'temp' => '100°C' ,
'status' => true
2026-10-27 09:12:51 +01:00
];
$tabPoele = [
2022-02-07 17:24:13 +01:00
'id' => 2 ,
'name' => 'Poêle' ,
'url' => '/assets/images/poele.png' ,
'time' => '5 minutes sur chaque face' ,
'temp' => '101°C' ,
'status' => true
2026-10-27 09:12:51 +01:00
];
$tabCocotte = [
2022-02-07 17:24:13 +01:00
'id' => 3 ,
'name' => 'Cocotte' ,
'url' => '/assets/images/cocotte.png' ,
'time' => '3 h' ,
'temp' => '80°C' ,
'status' => false
2026-10-27 09:12:51 +01:00
];
$tabPlancha = [
2022-02-07 17:24:13 +01:00
'id' => 4 ,
'name' => 'Plancha' ,
'url' => '/assets/images/plancha.png' ,
'time' => '20mins' ,
'temp' => '130°C' ,
'status' => false
2026-10-27 09:12:51 +01:00
];
$tabBainMarie = [
2022-02-07 17:24:13 +01:00
'id' => 5 ,
'name' => 'Bain Marie' ,
'url' => '/assets/images/bainmarie.png' ,
'time' => '30 mins à 45 mins' ,
'temp' => '80°C' ,
'status' => false
2026-10-27 09:12:51 +01:00
];
$tabBarbecue = [
2022-02-07 17:24:13 +01:00
'id' => 6 ,
'name' => 'Barbecue' ,
'url' => '/assets/images/barbecue.png' ,
'time' => '30 minutes' ,
'temp' => '200°C' ,
'status' => false
2026-10-27 09:12:51 +01:00
];
$tabMicroOndes = [
2022-02-07 17:24:13 +01:00
'id' => 7 ,
'name' => 'Micro Ondes' ,
'url' => '/assets/images/microondes.png' ,
'time' => '3mins' ,
'temp' => '900 Watts' ,
'status' => false
2026-10-27 09:12:51 +01:00
];
$tabCasserole = [
2022-02-07 17:24:13 +01:00
'id' => 8 ,
'name' => 'Casserole' ,
'url' => '/assets/images/casserole.png' ,
'time' => '10mins' ,
'temp' => '90°C' ,
'status' => false
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit1 = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Lorem ipsum set doloris' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit2 = [
2022-02-07 17:24:13 +01:00
'id' => 1 ,
'name' => 'Lorem ipsum set doloris' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit3 = [
2022-02-07 17:24:13 +01:00
'id' => 2 ,
'name' => 'Lorem ipsum set doloris' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
2021-12-20 17:21:09 +01:00
2022-02-07 17:24:13 +01:00
$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 );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ();
2026-10-27 09:12:51 +01:00
$tabPlusProduit1 = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Multiplier les recettes avec ce produit : plats mijotés, hot dog, salades...' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit2 = [
2022-02-07 17:24:13 +01:00
'id' => 1 ,
'name' => 'Une recette garantie sans colorant' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
2022-02-07 17:24:13 +01:00
$product = new Product ();
$product -> gamme_id = $gamme -> id ;
$product -> name = 'Chicken Franks Original' ;
$product -> slug = Str :: slug ( $product -> name );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ;
2026-10-27 09:12:51 +01:00
$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 );
2022-02-07 17:24:13 +01:00
$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 ();
2021-12-20 17:21:09 +01:00
2022-02-07 17:24:13 +01:00
$gamme = new Gamme ();
$gamme -> parent_gamme_id = $gameParent ;
$gamme -> title = 'Les mini' ;
$gamme -> slug = Str :: slug ( $gamme -> title );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ();
2026-10-27 09:12:51 +01:00
$tabMicroOndes = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Micro Ondes' ,
'url' => '/assets/images/micro-onde.png' ,
'time' => '3mins' ,
'temp' => '900 Watts' ,
'status' => true
2026-10-27 09:12:51 +01:00
];
$tabCasserole = [
2022-02-07 17:24:13 +01:00
'id' => 1 ,
'name' => 'Casserole' ,
'url' => '/assets/images/casserole.png' ,
'time' => '5mins' ,
'temp' => 'Au bain marie' ,
'status' => true
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit1 = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'La gourmandise à emporter partout !' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit2 = [
2022-02-07 17:24:13 +01:00
'id' => 1 ,
'name' => 'Le goût fromage, le petit plus qui fait qu\'on l\'adore' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
2022-02-07 17:24:13 +01:00
$product = new Product ();
$product -> gamme_id = $gamme -> id ;
$product -> name = 'Mini Chicken Franks Cheese' ;
$product -> slug = Str :: slug ( $product -> name );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ;
2026-10-27 09:12:51 +01:00
$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 );
2022-02-07 17:24:13 +01:00
$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 ();
2022-01-23 15:03:05 +01:00
2022-02-07 17:24:13 +01:00
$product = new Product ();
$product -> gamme_id = $gamme -> id ;
$product -> name = 'Mini Chicken Franks Original' ;
$product -> slug = Str :: slug ( $product -> name );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ;
2026-10-27 09:12:51 +01:00
$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 );
2022-02-07 17:24:13 +01:00
$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 ();
2021-12-22 17:32:05 +01:00
$gamme = new Gamme ();
$gamme -> parent_gamme_id = null ;
2022-02-07 17:24:13 +01:00
$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 ();
2026-10-27 09:12:51 +01:00
$tabPoele = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Poêle' ,
'url' => '/assets/images/poele.png' ,
'time' => '10mins' ,
'temp' => '' ,
'status' => true
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit1 = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Un hachage façon bouchère pour un goût et une texture exceptionnelle !' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit2 = [
2022-02-07 17:24:13 +01:00
'id' => 1 ,
'name' => '100% cuisse, 100% qualité' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
$tabPlusProduit3 = [
2022-02-07 17:24:13 +01:00
'id' => 2 ,
'name' => 'Une recette sans colorant, sans exhausteur de goût et sans conservateur' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
2022-02-07 17:24:13 +01:00
$product = new Product ();
$product -> gamme_id = $gamme -> id ;
$product -> name = 'Steak haché de poulet' ;
$product -> slug = Str :: slug ( $product -> name );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ;
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ;
2026-10-27 09:12:51 +01:00
$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 );
2022-02-07 17:24:13 +01:00
$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' ;
2021-12-22 17:32:05 +01:00
$gamme -> slug = Str :: slug ( $gamme -> title );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ());
2022-01-23 15:03:05 +01:00
$gamme -> picture = $imgpath ;
2022-02-07 17:24:13 +01:00
$gamme -> alt_text_picture = $gamme -> title ;
$upload = new SplFileInfo ( resource_path ( 'seeds/gammes/entete-volaille.jpg' ));
$bannerpath = Utils :: storeImage ( $upload , $gamme -> getTable ());
2022-01-23 15:03:05 +01:00
$gamme -> banner = $bannerpath ;
2022-02-07 17:24:13 +01:00
$gamme -> alt_text_banner = $gamme -> title ;
2021-12-22 17:32:05 +01:00
$gamme -> save ();
2026-10-27 09:12:51 +01:00
$tabPlusProduit1 = [
2022-02-07 17:24:13 +01:00
'id' => 0 ,
'name' => 'Volailles nourries exclusivement avec des végétaux, des minéraux et des vitamines' ,
'url' => '/assets/images/sans-label.jpg' ,
2026-10-27 09:12:51 +01:00
];
2022-02-07 17:24:13 +01:00
$product = new Product ();
$product -> gamme_id = $gamme -> id ;
$product -> name = 'Poulet sans abats' ;
$product -> slug = Str :: slug ( $product -> name );
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-07 17:24:13 +01:00
$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 ;
2026-10-27 09:12:51 +01:00
$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 );
2022-02-07 17:24:13 +01:00
$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 ();
2022-04-26 09:42:40 +02:00
$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 ();
2021-12-20 17:21:09 +01:00
}
}