ldc-nature-and-respect/routes/web-fo.php
2025-07-16 16:19:37 +02:00

55 lines
2.5 KiB
PHP

<?php
use App\Http\Controllers\Fo\ConceptController;
use App\Http\Controllers\Fo\ContactController;
use App\Http\Controllers\Fo\HomeController;
use App\Http\Controllers\Fo\NewsController;
use App\Http\Controllers\Fo\ProductController;
use App\Http\Controllers\Fo\RecipeController;
use App\Http\Controllers\Fo\StaticPageController;
use App\Http\Controllers\Fo\StoreController;
use Illuminate\Support\Facades\Route;
Route::namespace('\App\Http\Controllers\Fo')->middleware(['throttle:credentials'])->group(function () {
// * API Route.
Route::get('stores', [StoreController::class, 'city'])->name('stores.city');
// * Iframe cookies
Route::get('/frame/{frame}', fn (string $frame) => view('fo.pages.frame', ['frame' => $frame]))
->where('frame', '[a-z]+')->name('front.frame');
Route::localized(function () {
/** @var \Illuminate\Translation\Translator $trans */
$trans = trans();
// * PRODUCTS
Route::get($trans->uri('products'), [ProductController::class, 'index'])->name('products.index');
Route::get($trans->uri('product/{publishedProduct:slug}'), [ProductController::class, 'show'])
->name('product.show');
// * NEWS
Route::get($trans->uri('news'), [NewsController::class, 'index'])->name('news.index');
Route::get($trans->uri('news/{publishedNews:slug}'), [NewsController::class, 'show'])->name('news.show');
// * RECIPES
Route::get($trans->uri('recipes'), [RecipeController::class, 'index'])->name('recipes.index');
Route::get($trans->uri('recipes/{publishedRecipe:slug}'), [RecipeController::class, 'show'])
->name('recipe.show');
// * STORES
Route::get($trans->uri('storefinder'), [StoreController::class, 'index'])->name('storefinder.index');
// * CONTACT
Route::get($trans->uri('contact-us'), [ContactController::class, 'contactForm'])->name('contact-form');
Route::post($trans->uri('contact-us'), [ContactController::class, 'sendContactForm'])
->name('contact-form.send');
// * OTHERS
Route::get('/', [HomeController::class, 'index'])->name('home');
Route::get($trans->uri('legals'), [StaticPageController::class, 'legals'])->name('legals');
Route::get($trans->uri('privacy'), [StaticPageController::class, 'policies'])->name('privacy');
Route::get($trans->uri('concept/{concept:slug}'), [ConceptController::class, 'show'])->name('concept.show');
});
});
Route::fallback(\CodeZero\LocalizedRoutes\Controllers\FallbackController::class);