generated from boboko/starter
Feat: Updating routes and controllers to use the updated Services coming from boboko/core
This commit is contained in:
+11
-1
@@ -7,6 +7,16 @@
|
||||
use App\Http\Controllers\ProductController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
// Bare `/` has no {locale} segment to prefix-match against, so it's declared outside
|
||||
// the group below purely to give `locale` middleware a route to run on — the group's
|
||||
// `Route::prefix('{locale}')` requires a non-empty first segment, so `/` would
|
||||
// otherwise 404 before the middleware (which already redirects an empty/unrecognized
|
||||
// locale segment to the resolved default) ever gets a chance to run. Middleware runs
|
||||
// before controller parameter binding, so this never actually reaches
|
||||
// HomeController::index()'s required $locale argument — the middleware always
|
||||
// redirects a request with no matching locale segment first.
|
||||
Route::get('/', [HomeController::class, 'index'])->middleware('locale');
|
||||
|
||||
Route::prefix('{locale}')
|
||||
->middleware('locale')
|
||||
->group(function () {
|
||||
@@ -16,7 +26,7 @@
|
||||
'product.show',
|
||||
);
|
||||
|
||||
Route::get('/category/{collection}', [CategoryController::class, 'show'])->name(
|
||||
Route::get('/category/{id}', [CategoryController::class, 'show'])->name(
|
||||
'category.show',
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user