2026-07-03 13:46:54 +00:00
|
|
|
<?php
|
|
|
|
|
|
2026-08-08 14:50:10 +03:00
|
|
|
use App\Http\Controllers\HomeController;
|
2026-07-31 17:41:55 +03:00
|
|
|
use App\Http\Controllers\ProductController;
|
2026-07-03 13:46:54 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
2026-08-08 14:50:10 +03:00
|
|
|
// Bare root carries no language signal, so it just redirects to the default locale.
|
|
|
|
|
Route::redirect('/', '/'.config('app.locale'));
|
2026-07-31 17:41:55 +03:00
|
|
|
|
2026-08-08 14:50:10 +03:00
|
|
|
Route::prefix('{locale}')
|
|
|
|
|
->where(['locale' => implode('|', config('app.available_locales'))])
|
|
|
|
|
->middleware('setlocale')
|
|
|
|
|
->group(function () {
|
|
|
|
|
Route::get('/', [HomeController::class, 'index'])->name('home');
|
|
|
|
|
|
|
|
|
|
Route::get('/products/{product}', [ProductController::class, 'show'])->name(
|
|
|
|
|
'product.show',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Route::get('/__preview/newsletter-split', function () {
|
|
|
|
|
return view('__preview_newsletter_split');
|
|
|
|
|
});
|
|
|
|
|
});
|