From 87a4cecdc562fda97c8111d0add6ff641aed8e59 Mon Sep 17 00:00:00 2001 From: ZedoX <75579178+Z3d0X@users.noreply.github.com> Date: Mon, 14 Nov 2022 16:54:42 +0500 Subject: [PATCH] Fix: Homepage Routing (#24) - search by Page id, instead of slug --- routes/web.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index b7ca46a..0fe8a37 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,8 +13,12 @@ Route::get('/{filamentFabricatorPage?}', function (?Page $filamentFabricatorPage = null) { // Handle root (home) page if (blank($filamentFabricatorPage)) { + $pageUrls = FilamentFabricator::getPageUrls(); + + $pageId = array_search('/', $pageUrls); + $filamentFabricatorPage = FilamentFabricator::getPageModel()::query() - ->where('slug', '/') + ->where('id', $pageId) ->firstOrFail(); }