Skip to content

Commit

Permalink
Merge pull request #40 from pxlrbt/feature/38-ignore-resources
Browse files Browse the repository at this point in the history
#39 `shouldRegisterSpotlight()` for resources and resource pages
  • Loading branch information
pxlrbt authored Feb 22, 2024
2 parents b6232c0 + 871ad8d commit 138f1cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Actions/RegisterResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ public static function boot(Panel $panel)
$resources = $panel->getResources();

foreach ($resources as $resource) {
if (method_exists($resource, 'shouldRegisterSpotlight') && $resource::shouldRegisterSpotlight() === false) {
continue;
}

$pages = $resource::getPages();

foreach ($pages as $key => $page) {
if (method_exists($page->getPage(), 'shouldRegisterSpotlight') && $page->getPage()::shouldRegisterSpotlight() === false) {
continue;
}

/**
* @var PageRegistration $page
*/
Expand Down

0 comments on commit 138f1cf

Please sign in to comment.