Answer the question
In order to leave comments, you need to log in
How to correctly write a route for returning the same page to any get-request?
Now such a sheet is written, but I would like to do it in one fell swoop
Route::get('/', function () {
return view('index');
});
Route::get('/{x}', function () {
return view('index');
});
Route::get('/{x}/{y}', function () {
return view('index');
});
Route::get('/{x}/{y}/{z}', function () {
return view('index');
});
Answer the question
In order to leave comments, you need to log in
For SPA I use this
Route::get('{path}', function () {
return view('index');
})->where('path', '(.*)');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question