diff --git a/routes/web.php b/routes/web.php index 604d0888..601bbb8a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -89,3 +89,5 @@ Route::get('/sitemap.xml', [SitemapController::class, 'index'])->name('sitemap'); Route::get('/sitemap-projects.xml', [SitemapController::class, 'projects'])->name('sitemap.projects'); Route::get('/sitemap-items.xml', [SitemapController::class, 'items'])->name('sitemap.items'); + +Route::fallback(fn () => abort(404)); diff --git a/tests/Feature/NotFoundPageTest.php b/tests/Feature/NotFoundPageTest.php new file mode 100644 index 00000000..c4673913 --- /dev/null +++ b/tests/Feature/NotFoundPageTest.php @@ -0,0 +1,8 @@ +get('/this-page-does-not-exist'); + + $response->assertNotFound(); + expect($response->getContent())->toMatch('/"csrf":"[A-Za-z0-9]{40}"/'); +});