ldc-nature-and-respect/routes/web-fo.php

66 lines
2.3 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\ProductController;
use App\Http\Controllers\Fo\RecipeController;
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 () {
Route::get('/', [HomeController::class, 'index'])->name('home');
/** @var \Illuminate\Translation\Translator */
$trans = trans();
Route::get($trans->uri('products'), [ProductController::class, 'index'])->name('products.index');
Route::get(
$trans->uri('product/{publishedProduct:slug}'),
[ProductController::class, 'show']
)->name('product.show');
Route::get($trans->uri('recipes'), [RecipeController::class, 'index'])->name('recipes.index');
Route::get(
$trans->uri('recipes/{publishedRecipe:slug}'),
[RecipeController::class, 'show']
)->name('recipe.show');
Route::get($trans->uri('storefinder'), function () {
return view('fo.pages.storefinder');
})->name('storefinder.index');
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');
Route::get($trans->uri('legals'), function () {
return view('fo.pages.legals');
})->name('legals');
Route::get($trans->uri('privacy'), function () {
return view('fo.pages.privacy');
})->name('privacy');
Route::get(
$trans->uri('concept/{concept:slug}'),
[ConceptController::class, 'show']
)->name('concept.show');
});
});
Route::fallback(\CodeZero\LocalizedRoutes\Controllers\FallbackController::class);