Skip to content

Commit 5924010

Browse files
committed
let the application handle 404s
1 parent b40471d commit 5924010

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/vendor/
2-
.idea
2+
.idea/

src/ServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public function boot()
2020
* example: `/admin/products/25/edit` becomes `admin-products-edit`
2121
*/
2222
View::composer('*', function (\Illuminate\View\View $view) {
23+
24+
// Let app handle 404s
25+
if (!request()->route()) {
26+
return;
27+
}
28+
2329
$route = request()->route()->getPath();
2430

2531
// Remove route parameters. product_id is removed here: `controller/product/{product_id}`

0 commit comments

Comments
 (0)