diff --git a/app/Http/Controllers/Fo/StaticPageController.php b/app/Http/Controllers/Fo/StaticPageController.php new file mode 100644 index 0000000..d233b4c --- /dev/null +++ b/app/Http/Controllers/Fo/StaticPageController.php @@ -0,0 +1,46 @@ +where('type', StaticPageType::contact)->first(); + return view('fo.pages.legals', ['staticPageModel' => $contactPage]); + } + + /** + * Legal show + * + * @param \App\Models\StaticPage $legalPage + * @return \Illuminate\Contracts\View\View + */ + public function legals(StaticPage $legalPage) + { + $legalPage = StaticPage::query()->where('type', StaticPageType::legals)->first(); + return view('fo.pages.legals', ['staticPageModel' => $legalPage]); + } + + /** + * Policies show + * + * @param \App\Models\StaticPage $policiesPage + * @return \Illuminate\Contracts\View\View + */ + public function policies(StaticPage $policiesPage) + { + $policiesPage = StaticPage::query()->where('type', StaticPageType::confidentiality)->first(); + return view('fo.pages.legals', ['staticPageModel' => $policiesPage]); + } +} diff --git a/database/seeders/StaticPageSeeder.php b/database/seeders/StaticPageSeeder.php index c23c6b2..e561bf6 100644 --- a/database/seeders/StaticPageSeeder.php +++ b/database/seeders/StaticPageSeeder.php @@ -20,9 +20,9 @@ class StaticPageSeeder extends Seeder 'type' => StaticPageType::contact, ], [ - 'seo_title' => 'Seo title pour la page contactez nous', - 'seo_description' => 'Seo description pour la page contactez nous', - 'title' => 'Contactez-nous', + 'seo_title' => 'Seo title pour la page contact', + 'seo_description' => 'Seo description pour la page contact', + 'title' => 'Contact', 'type' => StaticPageType::contact, 'content' => \clean(\fake()->randomHtml(6, 7)), ] diff --git a/resources/views/fo/pages/legals.blade.php b/resources/views/fo/pages/legals.blade.php new file mode 100644 index 0000000..94f47b3 --- /dev/null +++ b/resources/views/fo/pages/legals.blade.php @@ -0,0 +1,23 @@ +@extends('fo.layout') + +@section('title', __($staticPageModel->seo_title)) +@section('description', __($staticPageModel->seo_description)) +@section('breadcrumb', + request()->route()->getName()) + +@section('content') +
+
+
+

{{ __($staticPageModel->title) }}

+
+
+
+
+
+
+ {!! clean($staticPageModel->content) !!} +
+
+
+@endsection diff --git a/routes/web-fo.php b/routes/web-fo.php index f50bdbb..db53eb1 100644 --- a/routes/web-fo.php +++ b/routes/web-fo.php @@ -1,6 +1,7 @@ name('homepage'); + Route::get('/contact', [StaticPageController::class, 'contact'])->name('contact.show'); + + // * LEGALS + Route::get('/mentions-legales', [StaticPageController::class, 'legals'])->name('legals.show'); + Route::get('/charte-de-confidentialite', [StaticPageController::class, 'policies'])->name('policies.show'); });