Merge branch 'develop' of lab.s-web.fr:ldc-web/projets/le-gaulois into issue-331

This commit is contained in:
System User 2026-04-23 10:08:17 +02:00
commit 4c5fda84b5
2 changed files with 149 additions and 120 deletions

View file

@ -12,124 +12,138 @@ return new class extends Migration
*/
public function up(): void
{
$data = [
'title' => [
'label' => 'Cahier de charge : Titre',
'inputType' => 11,
'value' => '',
'validate' => 'required|string|between:3,255',
'required' => true
],
'description' => [
'label' => 'Cahier de charge : Description',
'inputType' => 12,
'value' => '',
'validate' => 'required|string|min:15',
'required' => true
],
'picto' => [
'label' => 'Cahier de charge : Picto',
'inputType' => 4,
'dimensions' => [
'width' => 90,
'height' => 90
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'galery_title' => [
'label' => 'Slider : Titre',
'inputType' => 11,
'value' => '',
'validate' => 'required|string|between:3,255',
'required' => true
],
'slider_image_1' => [
'label' => 'Slider : Image 1',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'slider_image_2' => [
'label' => 'Slider : Image 2',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'slider_image_3' => [
'label' => 'Slider : Image 3',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'slider_image_4' => [
'label' => 'Slider : Image 4',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'nullable',
'required' => false
],
'slider_image_5' => [
'label' => 'Slider : Image 5',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'nullable',
'required' => false
],
'slider_image_6' => [
'label' => 'Slider : Image 6',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'nullable',
'required' => false
]
];
//SORTIR A L' EXTERIEUR
StaticPage::updateOrCreate(
['type' => StaticPageType::exitOutside],
['data' => [
'title' => [
'label' => 'Cahier de charge : Titre',
'inputType' => 11,
'value' => '',
'validate' => 'required|string|between:3,255',
'required' => true
],
'description' => [
'label' => 'Cahier de charge : Description',
'inputType' => 12,
'value' => '',
'validate' => 'required|string|min:15',
'required' => true
],
'picto' => [
'label' => 'Cahier de charge : Picto',
'inputType' => 4,
'dimensions' => [
'width' => 90,
'height' => 90
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'galery_title' => [
'label' => 'Slider : Titre',
'inputType' => 11,
'value' => '',
'validate' => 'required|string|between:3,255',
'required' => true
],
'slider_image_1' => [
'label' => 'Slider : Image 1',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'slider_image_2' => [
'label' => 'Slider : Image 2',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'slider_image_3' => [
'label' => 'Slider : Image 3',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'required',
'required' => true
],
'slider_image_4' => [
'label' => 'Slider : Image 4',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'nullable',
'required' => false
],
'slider_image_5' => [
'label' => 'Slider : Image 5',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'nullable',
'required' => false
],
'slider_image_6' => [
'label' => 'Slider : Image 6',
'inputType' => 4,
'dimensions' => [
'width' => 338,
'height' => 222
],
'alt' => '',
'title' => '',
'value' => '',
'validate' => 'nullable',
'required' => false
$staticPage = StaticPage::where('type', StaticPageType::exitOutside)->first();
if ($staticPage) {
$staticPage->data = $data;
$staticPage->saveQuietly();
} else {
StaticPage::query()->forceCreateQuietly(
[
'type' => StaticPageType::exitOutside->value(),
'seo_title' => 'Démarche sortant à l\'extérieur',
'seo_description' => 'Notre démarche inédite Le Gaulois "Sortant à l\'extérieur" s\'engage à ce que les volailles sortent',
'title' => 'Démarche sortant à l\'extérieur',
'slug' => 'demarche-sortant-a-l-exterieur',
'data' => $data
]
]]
);
);
}
}
/**

View file

@ -13,8 +13,7 @@ return new class extends Migration
public function up(): void
{
// OUI C EST BON
$staticPage = StaticPage::query()->where('type', StaticPageType::ouiCBon)->first();
$staticPage->data = [
$data = [
'title' => [
'label' => 'Cahier de charge : Titre',
'inputType' => 11,
@ -43,7 +42,23 @@ return new class extends Migration
'required' => true
]
];
$staticPage->saveQuietly();
$staticPage = StaticPage::where('type', StaticPageType::ouiCBon)->first();
if ($staticPage) {
$staticPage->data = $data;
$staticPage->saveQuietly();
} else {
StaticPage::query()->forceCreateQuietly(
[
'type' => StaticPageType::ouiCBon->value(),
'seo_title' => 'Oui c\'est bon',
'seo_description' => 'La marque 100% volaille française',
'title' => 'Démarche Oui c\'est bon',
'slug' => 'demarche-oui-c-est-bon',
'data' => $data
]
);
}
}
/**
@ -51,7 +66,7 @@ return new class extends Migration
*/
public function down(): void
{
Schema::table('static_pages', function() {
Schema::table('static_pages', function () {
$staticPage = StaticPage::query()->where('type', StaticPageType::ouiCBon)->first();
$staticPage->data = [];
$staticPage->saveQuietly();