diff --git a/user_guide_src/source/incoming/routing/069.php b/user_guide_src/source/incoming/routing/069.php index 991aa5c57b74..24d6366840a3 100644 --- a/user_guide_src/source/incoming/routing/069.php +++ b/user_guide_src/source/incoming/routing/069.php @@ -4,7 +4,10 @@ // Would execute the show404 method of the App\Errors class $routes->set404Override('App\Errors::show404'); -// Will display a custom view +// Will display a custom view. $routes->set404Override(static function () { - echo view('my_errors/not_found.html'); + // If you want to get the URI segments. + $segments = request()->getUri()->getSegments(); + + return view('my_errors/not_found.html'); });