Skip to content

Commit

Permalink
Fix: Homepage Routing (#24)
Browse files Browse the repository at this point in the history
- search by Page id, instead of slug
  • Loading branch information
Z3d0X authored Nov 14, 2022
1 parent 7d964d2 commit 87a4cec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 87a4cec

Please sign in to comment.