update routes name

This commit is contained in:
Alexis Gousseau 2024-03-14 10:09:22 +01:00
parent 7e5631fade
commit 4ab0de37b5
11 changed files with 81 additions and 27 deletions

View file

@ -17,7 +17,7 @@ class HireController extends Controller
*
* @return \Illuminate\Contracts\View\View
*/
public function index(): \Illuminate\Contracts\View\View
public function show(): \Illuminate\Contracts\View\View
{
$staticPageModel = StaticPage::query()->where('type', StaticPageType::we_hire)->first();
$sectionModels = Section::query()->where('page_id', $staticPageModel->id)->get();

View file

@ -19,7 +19,7 @@ class HomeController extends Controller
*
* @return \Illuminate\Contracts\View\View
*/
public function index(): \Illuminate\Contracts\View\View
public function show(): \Illuminate\Contracts\View\View
{
$staticPageModel = StaticPage::query()->where('type', StaticPageType::home)->first();
$sectionModels = Section::query()->where('page_id', $staticPageModel->id)->get();

View file

@ -114,6 +114,20 @@ class StaticPageController extends Controller
));
}
/**
* Display the 'we_produce' page.
*
* @return \Illuminate\Contracts\View\View
*/
public function produce(): \Illuminate\Contracts\View\View
{
$staticPageModel = StaticPage::query()->where('type', StaticPageType::we_produce)->first();
return view('fo.pages.produce', compact(
'staticPageModel',
));
}
/**
* Display the 'we_listen' page.
*
@ -140,7 +154,7 @@ class StaticPageController extends Controller
->send(new SendContactMail((object)$request->validated()));
Mail::to($request->validated()['email'])->send(new SendConfirmationMail((object)$request->validated()));
return redirect()->route('fo.listen')
return redirect()->route('fo.listen.show')
->with('success', trans(
'Bonjour, votre message a bien été transmis, nous vous en remercions. Cordialement, l’équipe :appName.',
['appName' => config('app.name')]

View file

@ -26,7 +26,7 @@ class RedirectIfAuthenticated
if (auth($guard)->check()) {
switch ($guard) {
case 'frontend':
return \redirect()->route('fo.homepage');
return \redirect()->route('fo.home.show');
case 'backend':
if (!$request->routeIs('bo.*')) {
continue;

View file

@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-xxl position-fixed fixed-top bg-body-tertiary shadow-sm" id="top-navbar">
<div class="container">
<a class="navbar-brand" data-bs-toggle="tooltip" data-bs-placement="bottom" href="{{ route('fo.homepage') }}"
<a class="navbar-brand" data-bs-toggle="tooltip" data-bs-placement="bottom" href="{{ route('fo.home.show') }}"
title="{{ __('Accéder au front du projet') }}" target="_blank">
{{ config('app.name', 'Laravel') }}
</a>

View file

@ -1,6 +1,6 @@
<div @class([
'border-top-curved-primary',
'bg-tertiary-light' => request()->routeIs('fo.commit'),
'bg-tertiary-light' => request()->routeIs('fo.commit.show'),
])>
<div class="text-bg-primary container-fluid">
<div class="row mb-3 pt-4">

View file

@ -20,9 +20,9 @@
<div class="mb-4 px-5">
<ul class="navbar-nav" role="menu">
<li class="nav-item mb-1">
@php $activePage = request()->routeIs('fo.homepage'); @endphp
@php $activePage = request()->routeIs('fo.home.show'); @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.homepage') }}" title="{{ __('Aller sur la page d\'Accueil') }}"
href="{{ route('fo.home.show') }}" title="{{ __('Aller sur la page d\'Accueil') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('Accueil') }}
</a>
@ -30,44 +30,47 @@
<li class="nav-item mb-1">
@php $activePage = false; @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.unveil') }}" title="{{ __('Aller sur la page On se dévoile') }}"
href="{{ route('fo.unveil.show') }}" title="{{ __('Aller sur la page On se dévoile') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('On se dévoile') }}
</a>
</li>
<li class="nav-item mb-1">
@php $activePage = false; @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip" href="{{ route('fo.hire.index') }}"
title="{{ __('Aller sur la page On embauche') }}" @if ($activePage) aria-current="page" @endif>
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.hire.show') }}" title="{{ __('Aller sur la page On embauche') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('On embauche') }}
</a>
</li>
<li class="nav-item mb-1">
@php $activePage = false; @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.commit') }}" title="{{ __('Aller sur la page On s\'engage') }}"
href="{{ route('fo.commit.show') }}" title="{{ __('Aller sur la page On s\'engage') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('On s\'engage') }}
</a>
</li>
<li class="nav-item mb-1">
@php $activePage = false; @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip" href="{{ route('fo.news.index') }}"
title="{{ __('Aller sur la page On bouge') }}" @if ($activePage) aria-current="page" @endif>
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.news.index') }}" title="{{ __('Aller sur la page On bouge') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('On bouge') }}
</a>
</li>
<li class="nav-item mb-1">
@php $activePage = false; @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip" href="#FIXME:route"
title="{{ __('Aller sur la page On produit') }}" @if ($activePage) aria-current="page" @endif>
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.produce.show') }}" title="{{ __('Aller sur la page On produit') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('On produit') }}
</a>
</li>
<li class="nav-item mb-1">
@php $activePage = false; @endphp
<a class="nav-link @if ($activePage) active @endif" data-bs-toggle="tooltip"
href="{{ route('fo.listen') }}" title="{{ __('Aller sur la page On vous écoute') }}"
href="{{ route('fo.listen.show') }}" title="{{ __('Aller sur la page On vous écoute') }}"
@if ($activePage) aria-current="page" @endif>
{{ __('On vous écoute') }}
</a>

View file

@ -109,7 +109,7 @@
@endif
<div class="d-flex justify-content-center mt-4">
<a class="btn btn-primary rounded-5 fw-bold border-primary border border-2"
href="{{ route('fo.hire.index') }}#we-testimonials"
href="{{ route('fo.hire.show') }}#we-testimonials"
title="{{ __('Retrouver nos témoignages') }}">{{ __('On témoigne') }}</a>
</div>
</div>

View file

@ -0,0 +1,33 @@
@extends('fo.layout')
@section('title', __($staticPageModel->seo_title))
@section('description', __($staticPageModel->seo_description))
@section('breadcrumb', request()->route()->getName())
@section('banner')
@include('fo.layouts.banner', [
'h1' => __($staticPageModel->title),
'asset' => Vite::asset('resources/assets/images/banners/home_reworked.jpg'),
'title' => __('Paysage d\'un champs de blé au soleil couchant avec une lisière en fond de tableau'),
'alt' => __('Image de fond'),
'displayArrow' => true,
'buttonLink' => '#listen',
])
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col">
<h1 class="f-intro-head-h-base text-center">{{ __($staticPageModel->title) }}</h1>
</div>
</div>
</div>
<div class="container">
<div class="row mb-5">
<div class="col ck-content">
{!! clean($staticPageModel->content) !!}
</div>
</div>
</div>
@endsection

View file

@ -31,7 +31,7 @@
@hasSection('button')
<a class="btn btn-primary fw-bold text-uppercase px-5 py-3 tracking-wider"
href="{{ app('router')->has('home') ? route('fo.homepage') : url('/') }}" role="button">
href="{{ app('router')->has('home') ? route('fo.home.show') : url('/') }}" role="button">
{{ __('Revenir à l\'accueil') }}
</a>
@endif

View file

@ -13,18 +13,22 @@ Route::middleware(['throttle:credentials'])->name('fo.')->group(function () {
Route::view('bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
}
// * HOME
Route::get('/', [HomeController::class, 'index'])->name('homepage');
Route::get('/on-se-devoile', [StaticPageController::class, 'unveil'])->name('unveil');
Route::get('/on-sengage', [StaticPageController::class, 'commit'])->name('commit');
Route::get('/on-vous-ecoute', [StaticPageController::class, 'listen'])->name('listen');
Route::get('/mentions-legales', [StaticPageController::class, 'listen'])->name('legals');
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'listen'])->name('confidentiality');
// * PAGES
Route::get('/', [HomeController::class, 'show'])->name('home.show');
Route::get('/on-se-devoile', [StaticPageController::class, 'unveil'])->name('unveil.show');
Route::get('/on-sengage', [StaticPageController::class, 'commit'])->name('commit.show');
Route::get('/on-vous-ecoute', [StaticPageController::class, 'listen'])->name('listen.show');
Route::get('/sites/{site:slug}', [SiteController::class, 'show'])->name('sites.show');
Route::get('/on-bouge', [NewsController::class, 'index'])->name('news.index');
Route::get('/on-bouge/{news:slug}', [NewsController::class, 'show'])->name('news.show');
Route::get('/on-embauche', [HireController::class, 'index'])->name('hire.index');
Route::get('/on-embauche', [HireController::class, 'show'])->name('hire.show');
Route::get('/on-produit', [StaticPageController::class, 'produce'])->name('produce.show');
// * RGPD
Route::get('/mentions-legales', [StaticPageController::class, 'listen'])->name('legals');
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'listen'])->name('confidentiality');
// * POST ROUTES
Route::post('/on-vous-ecoute-formulaire', [StaticPageController::class, 'listenForm'])->name('listen.send');
// * Iframe cookies