ldc-legaulois/routes/web-fo.php
2024-07-11 10:09:58 +02:00

94 lines
4.9 KiB
PHP

<?php
use App\Http\Controllers\Fo\HomeController;
use App\Http\Controllers\Fo\ProductController;
use App\Http\Controllers\Fo\RecipeController;
use App\Http\Controllers\Fo\StaticPageController;
use Illuminate\Support\Facades\Route;
Route::middleware(['throttle:web'])->name('fo.')->group(function () {
// * Dev route only
if (app()->environment('local', 'staging')) {
Route::view('/bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
Route::view('/partials-demo', 'fo.pages.partials-demo')->name('partials-demo');
}
// * STATIC PAGES
Route::get('/', [HomeController::class, 'index'])->name('home.show');
Route::post('/accueil/produits-par-gamme/{range_slug}', [
ProductController::class, 'jsonGetProductsViewsByRange'
])->name('home.products');
Route::post('/accueil/actualites_chaudes', [HomeController::class, 'updateHotNewsSatus'])
->name('home.hotnews');
Route::get('/recrutement', [StaticPageController::class, 'recruitment'])->name('recruitment.show');
Route::get('/mentions-legales', [StaticPageController::class, 'legals'])->name('legals.show');
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'policies'])->name('policies.show');
Route::get('/contact', [StaticPageController::class, 'contact'])->name('contact.show');
Route::get('/qui-sommes-nous', [StaticPageController::class, 'story'])->name('story.show');
Route::get('/saga-publicitaire', [StaticPageController::class, 'saga'])->name('saga.show');
// * PRODUCTS
Route::prefix('produits')
->name('products.')
->group(function () {
Route::get('/', [ProductController::class, 'index'])->name('index');
Route::get('/{slug}', [ProductController::class, 'show'])->name('show');
Route::name('search.')
->group(function () {
Route::get('/recherche/mots', [ProductController::class, 'getProductsByWords'])
->name('text');
Route::get('/recherche/mots/liste', [ProductController::class, 'getWordsList'])
->name('text-list');
Route::get('/gammes/{model_slug}', [ProductController::class, 'getProductsByRange'])
->name('range');
Route::get('/gammes/{model_slug}/{child_slug}', [
ProductController::class, 'getProductsBySubrange'
])->name('subrange');
Route::get('/viandes/{model_slug}', [ProductController::class, 'getProductsByMeat'])
->name('meat');
Route::get('/viandes/{model_slug}/{child_slug}', [
ProductController::class, 'getProductsBySubmeat'
])->name('submeat');
});
});
// * RECIPES
Route::prefix('recettes')
->name('recipes.')
->group(function () {
Route::get('/', [RecipeController::class, 'index'])->name('index');
Route::get('/{slug}', [RecipeController::class, 'show'])->name('show');
Route::get('/{slug}/print-commercial-sheet', [
RecipeController::class, 'printCommericalSheet'
])->name('print-commercial-sheet');
Route::name('search.')
->group(function () {
Route::get('/recherche/mots', [RecipeController::class, 'getRecipesByWords'])
->name('text');
Route::get('/recherche/mots/liste', [RecipeController::class, 'getWordsList'])
->name('text-list');
Route::get('/moments/{model_slug}', [RecipeController::class, 'getRecipesByConsumptionMoment'])
->name('consumption-moment');
Route::get('/viandes/{model_slug}', [RecipeController::class, 'getRecipesByMeat'])
->name('meat');
Route::get('/viandes/{model_slug}/{child_slug}', [
RecipeController::class, 'getRecipesBySubmeat'
])->name('submeat');
});
});
// * COMMITMENTS
Route::prefix('engagements')
->name('commitments.')
->group(function () {
Route::view('/', 'fo.pages.commitments.index')->name('index');
Route::view('/la-marque-100-francaise', 'fo.pages.commitments.brand')->name('brand');
Route::view('/elever-durablement', 'fo.pages.commitments.raise')->name('raise');
Route::view('/bien-nourrir-les-francais', 'fo.pages.commitments.eat')->name('eat');
Route::view('/favoriser-le-mieux-vivre-ensemble', 'fo.pages.commitments.life')->name('life');
Route::view('/respecter-la-terre', 'fo.pages.commitments.respect')->name('respect');
});
// * NEWSLETTER
Route::post('/optin', [HomeController::class, 'addOptIn'])->name('add-single-optin');
});