Skip to content

Commit 08187a5

Browse files
committed
refactor(routes): Replace catch-all route with fallback for improved routing
- Updated routing in web.php to use Route::fallback for rendering the app view. - Simplified route handling by removing the regex catch-all route.
1 parent 5c12a21 commit 08187a5

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • examples/dotcms-laravel/routes

examples/dotcms-laravel/routes/web.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
use Illuminate\Support\Facades\Route;
44

5-
Route::get('/', function () {
6-
return view('app'); // Change 'app' to your desired view name
7-
});
8-
95
// Catch-all route for rendering all paths with the same view
10-
Route::get('{any}', function () {
11-
return view('app'); // Change 'app' to the view you want to render
12-
})->where('any', '.*'); // Regex to match everything
6+
Route::fallback(function () {
7+
return view('app');
8+
});

0 commit comments

Comments
 (0)