mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 12:12:13 +00:00
Update README.md
Update section : ## Handling 404, 403 and other errors $exception->getCode to $exception->getCode()
This commit is contained in:
@@ -674,7 +674,7 @@ The code should be placed in the file that contains your routes.
|
|||||||
Router::get('/not-found', 'PageController@notFound');
|
Router::get('/not-found', 'PageController@notFound');
|
||||||
|
|
||||||
Router::error(function(Request $request, \Exception $exception) {
|
Router::error(function(Request $request, \Exception $exception) {
|
||||||
if($exception instanceof NotFoundHttpException && $exception->getCode == 404) {
|
if($exception instanceof NotFoundHttpException && $exception->getCode() == 404) {
|
||||||
response()->redirect('/not-found');
|
response()->redirect('/not-found');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user