ldc-nature-and-respect/routes/web-fo.php
Jérémy Munsch d109bbfdfd
Tons of fixes
2023-05-04 16:00:15 +02:00

63 lines
2.1 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 () {
Route::get('/', function () {
return redirect()->route('home');
});
// * API Route.
Route::get('stores/{city}', [StoreController::class, 'city'])->name('stores.city');
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');
});
});