ldc-doux/database/seeders/MomentsSeeder.php
2022-07-27 14:53:32 +02:00

125 lines
5.8 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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.";
// phpcs:ignore Generic.Files.LineLength.TooLong
$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>";
$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();
$moment = new Moment();
$moment->page = Page::marqueHistory();
$moment->title = "1980";
$moment->subtitle = "L'expansion internationale se poursuit.";
// phpcs:ignore Generic.Files.LineLength.TooLong
$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 !";
// phpcs:ignore Generic.Files.LineLength.TooLong
$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.";
// phpcs:ignore Generic.Files.LineLength.TooLong
$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.";
// phpcs:ignore Generic.Files.LineLength.TooLong
$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...";
// phpcs:ignore Generic.Files.LineLength.TooLong
$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();
}
}