diff --git a/database/assets/schema.png b/database/assets/schema.png new file mode 100644 index 0000000..9d52a7b Binary files /dev/null and b/database/assets/schema.png differ diff --git a/database/migrations/2024_06_21_145915_qa_section.php b/database/migrations/2024_06_21_145915_qa_section.php new file mode 100644 index 0000000..626dfba --- /dev/null +++ b/database/migrations/2024_06_21_145915_qa_section.php @@ -0,0 +1,71 @@ +items = array_merge(array_slice($this->items, 0, $target + 1), [$value], array_slice($this->items, $target + 1)); + return; + } + + foreach ($this->items as $key => $old) { + $new[$key] = $old; + if ($key === $target && is_null($new_key)) { + $new[] = $value; + } elseif ($key === $target) { + $new[$new_key] = $value; + } + } + + $this->items = $new; + }); + + $quality = Section::query()->where('section', PageSectionEnum::produce_quality)->first(); + if ($quality) { + $data = collect($quality->data); + $data->insertAfter( + 'bloc_text_de_la_partie2_content', + collect(Section::emptyPictureBloc([], FileStorageHelper::storeFile( + new Section(), + new \SplFileInfo(\resource_path( + '../database/assets/schema.png' + )) + ), fake()->sentence(), fake()->sentence(), 1208, 374))->first(), + 'bloc_image_de_la_partie2_content' + ); + $quality->data = $data->all(); + $quality->saveQuietly(); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down(): void + { + $rhd = Section::query()->where('section', PageSectionEnum::produce_rhd)->first(); + if ($rhd) { + $data = collect($rhd->data); + $data->forget('bloc_lien_de_limage1_de_la_partie1'); + $rhd->data = $data->all(); + $rhd->saveQuietly(); + } //end if + } +}; diff --git a/resources/views/fo/pages/produce/show.blade.php b/resources/views/fo/pages/produce/show.blade.php index 2a9e387..377e2d8 100644 --- a/resources/views/fo/pages/produce/show.blade.php +++ b/resources/views/fo/pages/produce/show.blade.php @@ -154,8 +154,9 @@
+