Skip to content

Commit

Permalink
#38 shouldRegisterSpotlight() for resources and resource pages
Browse files Browse the repository at this point in the history
  • Loading branch information
pxlrbt committed Feb 22, 2024
1 parent 6d8bbb2 commit 78dc616
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Actions/RegisterResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ 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 78dc616

Please sign in to comment.