Skip to content

Commit 860e1d3

Browse files
authored
Merge pull request #44 from tobiasla78/main
ignore pages with parameters
2 parents be7a05b + ecc302f commit 860e1d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Actions/RegisterPages.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public static function boot(Panel $panel)
2020
*/
2121
$page = new $pageClass;
2222

23+
if (self::hasParameters($page::getSlug())) {
24+
continue;
25+
}
26+
2327
if (method_exists($page, 'shouldRegisterSpotlight') && $page::shouldRegisterSpotlight() === false) {
2428
continue;
2529
}
@@ -43,4 +47,9 @@ public static function boot(Panel $panel)
4347
Spotlight::$commands[$command->getId()] = $command;
4448
}
4549
}
50+
51+
private static function hasParameters(string $slug): bool
52+
{
53+
return preg_match('/{[^}]+}/', $slug) === 1;
54+
}
4655
}

0 commit comments

Comments
 (0)