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

64 lines
2.1 KiB
PHP
Raw Normal View History

2022-11-18 12:39:03 +01:00
<?php
use App\Http\Controllers\Fo\ConceptController;
2023-04-05 10:48:56 +00:00
use App\Http\Controllers\Fo\ContactController;
2023-03-15 10:31:55 +01:00
use App\Http\Controllers\Fo\HomeController;
2023-04-05 10:48:56 +00:00
use App\Http\Controllers\Fo\ProductController;
use App\Http\Controllers\Fo\RecipeController;
use App\Http\Controllers\Fo\StoreController;
2022-11-18 12:39:03 +01:00
use Illuminate\Support\Facades\Route;
2023-04-19 14:14:02 +02:00
Route::namespace('\App\Http\Controllers\Fo')->middleware(['throttle:credentials'])->group(function () {
2023-04-25 15:54:34 +02:00
Route::get('/', function () {
return redirect()->route('home');
});
// * API Route.
Route::get('stores/{city}', [StoreController::class, 'city'])->name('stores.city');
2023-04-19 14:14:02 +02:00
Route::localized(function () {
Route::get('/', [HomeController::class, 'index'])->name('home');
2023-05-04 16:00:15 +02:00
/** @var \Illuminate\Translation\Translator */
$trans = trans();
2023-05-04 16:00:15 +02:00
Route::get($trans->uri('products'), [ProductController::class, 'index'])->name('products.index');
2023-05-04 16:00:15 +02:00
Route::get(
$trans->uri('product/{publishedProduct:slug}'),
[ProductController::class, 'show']
)->name('product.show');
2023-05-04 16:00:15 +02:00
Route::get($trans->uri('recipes'), [RecipeController::class, 'index'])->name('recipes.index');
2023-04-19 15:34:44 +02:00
2023-05-04 16:00:15 +02:00
Route::get(
$trans->uri('recipes/{publishedRecipe:slug}'),
[RecipeController::class, 'show']
)->name('recipe.show');
Route::get($trans->uri('storefinder'), function () {
2023-04-19 14:14:02 +02:00
return view('fo.pages.storefinder');
2023-04-19 15:34:44 +02:00
})->name('storefinder.index');
2023-05-04 16:00:15 +02:00
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');
2023-05-04 16:00:15 +02:00
Route::get($trans->uri('legals'), function () {
2023-04-19 14:14:02 +02:00
return view('fo.pages.legals');
2023-04-19 15:34:44 +02:00
})->name('legals');
2023-05-04 16:00:15 +02:00
Route::get($trans->uri('privacy'), function () {
2023-04-19 14:14:02 +02:00
return view('fo.pages.privacy');
2023-04-19 15:34:44 +02:00
})->name('privacy');
2023-05-04 16:00:15 +02:00
Route::get(
$trans->uri('concept/{concept:slug}'),
[ConceptController::class, 'show']
)->name('concept.show');
2023-04-19 14:14:02 +02:00
});
});