ldc-doux/database/seeders/MomentsSeeder.php

126 lines
5.8 KiB
PHP
Raw Permalink Normal View History

2022-01-30 13:57:46 +01:00
<?php
namespace Database\Seeders;
use App\Enums\Page;
use App\Lib\Utils;
use App\Models\Moment;
use Illuminate\Database\Seeder;
use SplFileInfo;
class MomentsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1933";
$moment->subtitle = "Le début d'une longue histoire";
$moment->text = "<p>Pierre Doux démarre une activité de négoce de poulet dans le Grand Ouest français.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1933.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1955";
$moment->subtitle = "Doux, naissance d'une marque.";
$moment->text = "<p>Pierre Doux décide de fonder l’entreprise qui portera son nom.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1955.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1961";
$moment->subtitle = "Le poulet prend son envol.";
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-01 10:02:05 +01:00
$moment->text = "<p>Il s'exporte d’abord vers l’Allemagne et la Suisse, puis, dans les années 70 vers d’autres pays comme la Russie ou le Liban.</p>";
2022-01-30 13:57:46 +01:00
$upload = new SplFileInfo(resource_path('seeds/moments/1961.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
2022-02-01 10:02:05 +01:00
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1980";
$moment->subtitle = "L'expansion internationale se poursuit.";
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-01 10:02:05 +01:00
$moment->text = "<p>Le développement de la marque à l'export continue tout au long de la décennie, principalement vers le Moyen-Orient mais aussi en Afrique.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1980.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1992";
$moment->subtitle = "La naissance d'un produit iconique !";
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-01 10:02:05 +01:00
$moment->text = "<p>Le spécialiste de la volaille lance sa Chicken Franks Doux, un produit emblématique. Et vous l'adorez depuis !</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1992.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1992";
$moment->subtitle = "Un nouveau défi.";
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-01 10:02:05 +01:00
$moment->text = "<p>Toujours désireuse d'apporter plus de variété dans vos assiettes, la marque Doux se lance dans la production de produits élaborés destinés à l’export, tels que les nuggets, les burgers ou les escalopes panées.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/1992_bis.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "2018";
$moment->subtitle = "L'année du renouveau.";
$moment->text = "<p>La marque Doux intègre LDC, leader français de la volaille.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/2018.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "2019";
$moment->subtitle = "Un vent de fraicheur.";
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-01 10:02:05 +01:00
$moment->text = "<p>La marque Doux s'offre un nouveau look plus moderne, sans rien changer au goût tant apprécié de ses produits.</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/88832_2.png'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "2021";
$moment->subtitle = "Doux Innove...";
2022-07-27 14:53:32 +02:00
// phpcs:ignore Generic.Files.LineLength.TooLong
2022-02-01 10:02:05 +01:00
$moment->text = "<p>...et lance le Steak haché de poulet façon bouchère et les Mini Chicken Franks : Découvrez ces nouveaux produits inédits !</p>";
$upload = new SplFileInfo(resource_path('seeds/moments/2021.jpg'));
$imgpath = Utils::storeImage($upload, $moment->getTable());
$moment->picture = $imgpath;
$moment->alt_text_picture = $moment->subtitle;
$moment->save();
2022-01-30 13:57:46 +01:00
}
}