Merge branch 'finalisation-recette' into develop
This commit is contained in:
commit
66dc8cb800
15 changed files with 194 additions and 90 deletions
|
|
@ -3,7 +3,11 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\Page;
|
||||
use App\Models\Encart;
|
||||
use App\Models\Picto;
|
||||
use App\Models\Product;
|
||||
use App\Models\SeoDatum;
|
||||
use App\Models\Title;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FoodServiceController extends Controller
|
||||
|
|
@ -13,6 +17,12 @@ class FoodServiceController extends Controller
|
|||
$page = Page::foodservice();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
|
||||
return view('front.food-service', compact('seoDatum'));
|
||||
$encart_food = Encart::where('page', Page::foodHeader()->value)->first();
|
||||
$title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
|
||||
$pictos_food = Picto::where('page', Page::foodBloc2()->value)->get();
|
||||
$products_food = Product::where('is_food_service', true)->get();
|
||||
|
||||
return view('front.food-service', compact('seoDatum' , 'encart_food', 'title_foodBloc2',
|
||||
'pictos_food', 'products_food'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\Page;
|
||||
use App\Models\Encart;
|
||||
use App\Models\Post;
|
||||
use App\Models\Product;
|
||||
use App\Models\SeoDatum;
|
||||
use App\Models\Slide;
|
||||
use App\Models\Slider;
|
||||
|
|
@ -32,9 +35,20 @@ class HomeController extends Controller
|
|||
});
|
||||
})->orderBy('order', 'ASC')
|
||||
->get();
|
||||
return view('front.home', compact('slider', 'slides', 'seoDatum'));
|
||||
} else {
|
||||
return view('front.home', compact('slider', 'seoDatum'));
|
||||
$slides = null;
|
||||
}
|
||||
|
||||
$encart_home = Encart::where('page', Page::homeHeader()->value)->first();
|
||||
|
||||
$post_home = Post::where([
|
||||
['date_start', '<=', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['date_end', '>', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['on_top', true]
|
||||
])->first();
|
||||
// Limitation à 3 produits affichés sur la homepage
|
||||
$products_home = Product::where('is_on_top', true)->take(3)->get();
|
||||
|
||||
return view('front.home', compact('slider', 'slides', 'seoDatum', 'encart_home', 'post_home', 'products_home'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ class LegalsController extends Controller
|
|||
$seoDatum = new SeoDatum();
|
||||
$seoDatum->title = $mentions_legales->title;
|
||||
|
||||
return view('front.legals', compact('seoDatum'));
|
||||
return view('front.legals', compact('seoDatum' ,'mentions_legales'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,12 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\Page;
|
||||
use App\Models\Encart;
|
||||
use App\Models\Moment;
|
||||
use App\Models\Picto;
|
||||
use App\Models\PictoBrand;
|
||||
use App\Models\SeoDatum;
|
||||
use App\Models\Title;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MarqueController extends Controller
|
||||
|
|
@ -13,6 +18,19 @@ class MarqueController extends Controller
|
|||
$page = Page::marque();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
|
||||
return view('front.a-propos', compact('seoDatum'));
|
||||
$encart_marqueHeader = Encart::where('page', Page::marqueHeader()->value)->first();
|
||||
$encart_marqueBloc4l = Encart::where('page', Page::marqueBloc4l()->value)->first();
|
||||
$encart_marqueBloc4r = Encart::where('page', Page::marqueBloc4r()->value)->first();
|
||||
$encart_marqueFooter = Encart::where('page', Page::marqueFooter()->value)->first();
|
||||
|
||||
$pictobrands_marque = PictoBrand::all();
|
||||
$pictos_marqueBloc2 = Picto::where('page', Page::marqueBloc2()->value)->get();
|
||||
$title_marqueBloc2 = Title::where('page', Page::marqueBloc2()->value)->first();
|
||||
$title_marqueBloc4 = Title::where('page', Page::marqueBloc4()->value)->first();
|
||||
$moments = Moment::where('page', Page::marqueHistory()->value)->get();
|
||||
|
||||
return view('front.a-propos', compact('seoDatum', 'encart_marqueHeader', 'encart_marqueBloc4l',
|
||||
'encart_marqueBloc4r', 'encart_marqueFooter', 'pictobrands_marque', 'title_marqueBloc2',
|
||||
'pictos_marqueBloc2', 'moments', 'title_marqueBloc4'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,14 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Enums\Page;
|
||||
use App\Models\Advice;
|
||||
use App\Models\Post;
|
||||
use App\Models\Product;
|
||||
use App\Models\SeoDatum;
|
||||
use App\Models\Text;
|
||||
use App\Models\Title;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class NewsController extends Controller
|
||||
{
|
||||
|
|
@ -13,6 +19,19 @@ class NewsController extends Controller
|
|||
$page = Page::news();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
|
||||
return view('front.news', compact('seoDatum'));
|
||||
$advice_news = Advice::all()->first();
|
||||
$texts_news = Text::where('page', Page::newsQuestions()->value)->get();
|
||||
$title_newsPosts = Title::where('page', Page::newsPosts()->value)->first();
|
||||
|
||||
$posts = Post::where([
|
||||
['date_start', '<=', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['date_end', '>', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
])
|
||||
->orderBy('created_at', 'DESC')
|
||||
->get();
|
||||
|
||||
$products_news = Product::where('is_news', true)->get();
|
||||
|
||||
return view('front.news', compact('seoDatum', 'advice_news' , 'texts_news', 'title_newsPosts', 'posts', 'products_news'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ class PolicyController extends Controller
|
|||
$seoDatum = new SeoDatum();
|
||||
$seoDatum->title = $privacy_policy->title;
|
||||
|
||||
return view('front.policy', compact('seoDatum'));
|
||||
return view('front.policy', compact('seoDatum', 'privacy_policy'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
namespace App\Http;
|
||||
|
||||
use App\Http\Middleware\InitVarsGlobals;
|
||||
use App\Http\Middleware\BackEndGlobals;
|
||||
use App\Http\Middleware\FrontEndGlobals;
|
||||
use App\Http\Middleware\LangCheck;
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
|
|
@ -63,7 +64,8 @@ class Kernel extends HttpKernel
|
|||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'init-vars' => InitVarsGlobals::class,
|
||||
'lang-check' => LangCheck::class,
|
||||
'front-end-globals' => FrontEndGlobals::class,
|
||||
'back-end-globals' => BackEndGlobals::class,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,37 +2,29 @@
|
|||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Enums\Page;
|
||||
use App\Models\Advice;
|
||||
use App\Models\Encart;
|
||||
use App\Models\Gamme;
|
||||
use App\Models\Moment;
|
||||
use App\Models\Picto;
|
||||
use App\Models\PictoBrand;
|
||||
use App\Models\Post;
|
||||
use App\Models\Product;
|
||||
use App\Models\Text;
|
||||
use App\Models\Title;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class InitVarsGlobals
|
||||
class BackEndGlobals
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$encart_home = Encart::where('page', Page::homeHeader()->value)->first();
|
||||
$encart_marqueHeader = Encart::where('page', Page::marqueHeader()->value)->first();
|
||||
$encart_marqueBloc2 = Encart::where('page', Page::marqueBloc2()->value)->first();
|
||||
$encart_marqueBloc3 = Encart::where('page', Page::marqueBloc3()->value)->first();
|
||||
$encart_marqueBloc4l = Encart::where('page', Page::marqueBloc4l()->value)->first();
|
||||
$encart_marqueBloc4r = Encart::where('page', Page::marqueBloc4r()->value)->first();
|
||||
$encart_marqueFooter = Encart::where('page', Page::marqueFooter()->value)->first();
|
||||
|
|
@ -40,28 +32,8 @@ class InitVarsGlobals
|
|||
$mentions_legales = Text::where('page', Page::mentions()->value)->first();
|
||||
$privacy_policy = Text::where('page', Page::charte()->value)->first();
|
||||
|
||||
$pictobrands_marque = PictoBrand::all();
|
||||
|
||||
$advice_news = Advice::all()->first();
|
||||
|
||||
$posts = Post::where([
|
||||
['date_start', '<=', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['date_end', '>', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
])
|
||||
->orderBy('created_at', 'DESC')
|
||||
->get();
|
||||
$post_home = Post::where([
|
||||
['date_start', '<=', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['date_end', '>', Carbon::now()->format('Y-m-d H:i:s')],
|
||||
['on_top', true]
|
||||
])->first();
|
||||
// Limitation à 3 produits affichés sur la homepage
|
||||
$products_home = Product::where('is_on_top', true)->take(3)->get();
|
||||
// produits affichés sur la page news
|
||||
$products_news = Product::where('is_news', true)->get();
|
||||
// Produits affichés sur la page Food Service
|
||||
$products_food = Product::where('is_food_service', true)->get();
|
||||
|
||||
$pictos_marqueBloc2 = Picto::where('page', Page::marqueBloc2()->value)->get();
|
||||
$pictos_food = Picto::where('page', Page::foodBloc2()->value)->get();
|
||||
|
||||
|
|
@ -72,26 +44,12 @@ class InitVarsGlobals
|
|||
$title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
|
||||
$title_newsPosts = Title::where('page', Page::newsPosts()->value)->first();
|
||||
|
||||
$moments = Moment::where('page', Page::marqueHistory()->value)->get();
|
||||
|
||||
View::share('encart_home', $encart_home);
|
||||
View::share('encart_marqueHeader', $encart_marqueHeader);
|
||||
View::share('encart_marqueBloc2', $encart_marqueBloc2);
|
||||
View::share('encart_marqueBloc3', $encart_marqueBloc3);
|
||||
View::share('encart_marqueBloc4l', $encart_marqueBloc4l);
|
||||
View::share('encart_marqueBloc4r', $encart_marqueBloc4r);
|
||||
View::share('encart_marqueFooter', $encart_marqueFooter);
|
||||
View::share('encart_food', $encart_food);
|
||||
|
||||
View::share('pictobrands_marque', $pictobrands_marque);
|
||||
|
||||
View::share('post_home', $post_home);
|
||||
View::share('posts', $posts);
|
||||
|
||||
View::share('products_home', $products_home);
|
||||
View::share('products_news', $products_news);
|
||||
View::share('products_food', $products_food);
|
||||
|
||||
View::share('advice_news', $advice_news);
|
||||
|
||||
View::share('pictos_marqueBloc2', $pictos_marqueBloc2);
|
||||
|
|
@ -104,8 +62,6 @@ class InitVarsGlobals
|
|||
View::share('title_foodBloc2', $title_foodBloc2);
|
||||
View::share('title_newsPosts', $title_newsPosts);
|
||||
|
||||
View::share('moments', $moments);
|
||||
|
||||
View::share('mentions_legales', $mentions_legales);
|
||||
View::share('privacy_policy', $privacy_policy);
|
||||
|
||||
54
app/Http/Middleware/FrontEndGlobals.php
Normal file
54
app/Http/Middleware/FrontEndGlobals.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class FrontEndGlobals
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
//header menu
|
||||
$currentRoute = Route::current()->getName();
|
||||
$routeParamsFR = Route::current()->parameters();
|
||||
$routeParamsEN = $routeParamsFR;
|
||||
$routeParamsES = $routeParamsFR;
|
||||
array_walk($routeParamsFR, array($this, 'unbind'),'');
|
||||
array_walk($routeParamsEN, array($this, 'unbind'),'en');
|
||||
array_walk($routeParamsES, array($this, 'unbind'),'es');
|
||||
if (preg_match('/^(en|es)/', $currentRoute )) {
|
||||
$currentRouteFR = preg_replace('/^(en|es)\./', '', $currentRoute,1);
|
||||
$currentRouteEN = preg_replace('/^(en|es)/', 'en', $currentRoute,1);
|
||||
$currentRouteES = preg_replace('/^(en|es)/', 'es', $currentRoute,1);
|
||||
} else {
|
||||
$currentRouteFR = $currentRoute;
|
||||
$currentRouteEN = 'en.'.$currentRoute;
|
||||
$currentRouteES = 'es.'.$currentRoute;
|
||||
}
|
||||
|
||||
View::share('currentRouteFR', $currentRouteFR);
|
||||
View::share('currentRouteEN', $currentRouteEN);
|
||||
View::share('currentRouteES', $currentRouteES);
|
||||
View::share('routeParamsFR', $routeParamsFR);
|
||||
View::share('routeParamsEN', $routeParamsEN);
|
||||
View::share('routeParamsES', $routeParamsES);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
public function unbind(&$item,$k,$lang) {
|
||||
if($k=='gammeSlug' || $k=='productSlug') {
|
||||
$item = $item->getTranslation('slug', $lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
resources/lang/en/urls.php
Normal file
14
resources/lang/en/urls.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
return array (
|
||||
'contact' => 'contact',
|
||||
'food-service' => 'food-service',
|
||||
'gamme' => 'category',
|
||||
'gammes' => 'products',
|
||||
'legals' => 'terms-and-conditions',
|
||||
'marque' => 'brand',
|
||||
'news' => 'news',
|
||||
'policy' => 'privacy-policy',
|
||||
'produit' => 'product',
|
||||
'search' => 'search',
|
||||
);
|
||||
14
resources/lang/es/urls.php
Normal file
14
resources/lang/es/urls.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
return array (
|
||||
'contact' => 'contacto',
|
||||
'food-service' => 'food-service',
|
||||
'gamme' => 'gama',
|
||||
'gammes' => 'productos',
|
||||
'legals' => 'terminos-y-condiciones-de-uso',
|
||||
'marque' => 'marca',
|
||||
'news' => 'noticias',
|
||||
'policy' => 'política-de-privacidad',
|
||||
'produit' => 'producto',
|
||||
'search' => 'buscar',
|
||||
);
|
||||
14
resources/lang/fr/urls.php
Normal file
14
resources/lang/fr/urls.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'marque' => 'notre-marque',
|
||||
'gammes' => 'nos-gammes',
|
||||
'gamme' => 'gamme',
|
||||
'produit' => 'produit',
|
||||
'news' => 'nos-actualites',
|
||||
'food-service' => 'food-service',
|
||||
'legals' => 'mentions-legales',
|
||||
'policy' => 'charte-confidentialite',
|
||||
'search' => 'recherche',
|
||||
'contact' => 'contact'
|
||||
];
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="menu-overlay__icon"></div>
|
||||
</label>
|
||||
<ul class="menu__list">
|
||||
<a href="{{ route($routeprefixer . 'wasup') }}" class="scroller menu__link @if (Route::current()->getName() == 'wasup') menu__item--current @endif">
|
||||
<a href="{{ route($routeprefixer . 'wasup') }}" class="scroller menu__link @if (Route::current()->getName() == $routeprefixer . 'wasup') menu__item--current @endif">
|
||||
<li class="menu__item">
|
||||
{{ __('Marque') }}
|
||||
</li>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<path class="cnt" d="M.85,16.34,7.34,9.17.82,2.07C4.21.91,5.86,2.13,11,9.15,5.8,16.53,3.87,18,.85,16.34Z" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="{{ route($routeprefixer . 'gammes.index') }}" class="scroller menu__link @if (Route::current()->getName() == 'gammes.index') menu__item--current @endif">
|
||||
<a href="{{ route($routeprefixer . 'gammes.index') }}" class="scroller menu__link @if (Route::current()->getName() == $routeprefixer . 'gammes.index') menu__item--current @endif">
|
||||
<li class="menu__item">
|
||||
{{ __('Produits') }}
|
||||
</li>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<path class="cnt" d="M.85,16.34,7.34,9.17.82,2.07C4.21.91,5.86,2.13,11,9.15,5.8,16.53,3.87,18,.85,16.34Z" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="{{ route($routeprefixer . 'news') }}" class="scroller menu__link @if (Route::current()->getName() == 'news') menu__item--current @endif">
|
||||
<a href="{{ route($routeprefixer . 'news') }}" class="scroller menu__link @if (Route::current()->getName() == $routeprefixer . 'news') menu__item--current @endif">
|
||||
<li class="menu__item">
|
||||
{{ __('Actualités') }}
|
||||
</li>
|
||||
|
|
@ -100,21 +100,9 @@
|
|||
|
||||
<span class="secondmenu">
|
||||
<ul class="traduction">
|
||||
@php
|
||||
$currentUrl = Request::path();
|
||||
if (preg_match('/^(en|es)/', $currentUrl )) {
|
||||
$currentUrlFR = preg_replace('/\/\//','/', '/' . preg_replace('/^(en|es)/', '', $currentUrl,1));
|
||||
$currentUrlEN = preg_replace('/\/\//','/', '/' . preg_replace('/^(en|es)/', 'en', $currentUrl,1));
|
||||
$currentUrlES = preg_replace('/\/\//','/', '/' . preg_replace('/^(en|es)/', 'es', $currentUrl,1));
|
||||
} else {
|
||||
$currentUrlFR = preg_replace('/\/\//','/', '/' . $currentUrl);
|
||||
$currentUrlEN = preg_replace('/\/\//','/','/' . preg_replace('/^/', 'en/', $currentUrl,1));
|
||||
$currentUrlES = preg_replace('/\/\//','/','/' . preg_replace('/^/', 'es/', $currentUrl,1));
|
||||
}
|
||||
@endphp
|
||||
<li class="@if(App::getLocale() == 'fr') current @endif"><a href="{{ $currentUrlFR }}">fr</a></li>
|
||||
<li class="@if(App::getLocale() == 'en') current @endif"><a href="{{ $currentUrlEN }}">en</a></li>
|
||||
<li class="@if(App::getLocale() == 'es') current @endif"><a href="{{ $currentUrlES }}">es</a></li>
|
||||
<li class="@if(App::getLocale() == 'fr') current @endif"><a href="{{ route($currentRouteFR, $routeParamsFR) }}">fr</a></li>
|
||||
<li class="@if(App::getLocale() == 'en') current @endif"><a href="{{ route($currentRouteEN, $routeParamsEN) }}">en</a></li>
|
||||
<li class="@if(App::getLocale() == 'es') current @endif"><a href="{{ route($currentRouteES, $routeParamsES) }}">es</a></li>
|
||||
</ul>
|
||||
<div class="search-bloc search-form">
|
||||
<form class="form" method="GET" action="{{ route($routeprefixer . 'search') }}">
|
||||
|
|
@ -135,7 +123,6 @@
|
|||
</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
var loupe = document.querySelector("div#search");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
@if(isset($optional) && $optional)<option value> ----- </option>@endif
|
||||
@foreach($items as $key => $value)
|
||||
@if(is_numeric($key))
|
||||
@if($value=="single" || $value=="home" || $value=="rgpd" )
|
||||
@if($value=="single" || $value=="home" || $value=="rgpd" || $value=="urls" )
|
||||
<option value="{{ $value }}" @if(isset($selected) && $selected === $value) selected="selected" @endif>{{ $value }}</option>
|
||||
@endif
|
||||
@else
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ use App\Http\Controllers\LegalsController as ControllersLegalsController;
|
|||
use App\Http\Controllers\PolicyController as ControllersPolicyController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -68,7 +70,7 @@ Route::prefix('bo')
|
|||
);
|
||||
}
|
||||
);
|
||||
Route::middleware(['auth:web', 'init-vars', 'lang-check'])
|
||||
Route::middleware(['auth:web', 'back-end-globals', 'lang-check'])
|
||||
->group(
|
||||
function () {
|
||||
Route::get(
|
||||
|
|
@ -117,27 +119,27 @@ Route::prefix('bo')
|
|||
$langs = ['en', 'es', ''];
|
||||
|
||||
foreach ($langs as $lang) {
|
||||
Route::middleware(['init-vars', 'lang-check'])
|
||||
Route::middleware(['front-end-globals', 'lang-check'])
|
||||
->prefix($lang)
|
||||
->name($lang == '' ? '' : $lang . '.')
|
||||
->group(
|
||||
function () {
|
||||
function () use ($lang) {
|
||||
Route::get('/', [ControllersHomeController::class, 'index'])->name('home');
|
||||
Route::get('/notre-marque', [ControllersMarqueController::class, 'index'])->name('wasup');
|
||||
Route::get('/nos-gammes', [ControllersGammesController::class, 'index'])->name('gammes.index');
|
||||
Route::get('/gamme/{gammeSlug}', [ControllersGammesController::class, 'show'])->name('gammes.show');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.marque',[], $lang)), [ControllersMarqueController::class, 'index'])->name('wasup');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.gammes',[], $lang)), [ControllersGammesController::class, 'index'])->name('gammes.index');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.gamme',[], $lang)).'/{gammeSlug}', [ControllersGammesController::class, 'show'])->name('gammes.show');
|
||||
Route::get(
|
||||
'/produit/{gammeSlug}/{productSlug}',
|
||||
[ControllersProductsController::class, 'show']
|
||||
)->name('product.show');
|
||||
Route::get('/nos-actualites', [ControllersNewsController::class, 'index'])->name('news');
|
||||
Route::get('/food-service', [ControllersFoodServiceController::class, 'index'])->name('food');
|
||||
Route::get('/mentions-legales', [ControllersLegalsController::class, 'index'])->name('cgu');
|
||||
Route::get('/charte-confidentialite', [ControllersPolicyController::class, 'index'])->name('policy');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.news',[], $lang)), [ControllersNewsController::class, 'index'])->name('news');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.food-service',[], $lang)), [ControllersFoodServiceController::class, 'index'])->name('food');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.legals',[], $lang)), [ControllersLegalsController::class, 'index'])->name('cgu');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.policy',[], $lang)), [ControllersPolicyController::class, 'index'])->name('policy');
|
||||
//Route::view('/plan-site', 'front.site-map')->name('site-map');
|
||||
Route::get('/recherche', [ControllersProductsController::class, 'search'])->name('search');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.search',[], $lang)), [ControllersProductsController::class, 'search'])->name('search');
|
||||
//Classic
|
||||
Route::get('/contact', [ControllersContactController::class, 'contact'])->name('contact');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.contact',[], $lang)), [ControllersContactController::class, 'contact'])->name('contact');
|
||||
Route::post('/contact', [ControllersContactController::class, 'contactSubmit'])->name('contact.submit');
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue