Skip to content

Commit

Permalink
Nested MenuManager
Browse files Browse the repository at this point in the history
Issue #1522
  • Loading branch information
lee-to authored Feb 9, 2025
1 parent 39385a7 commit 55a18c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Menu/MenuManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function prepareMenu(Collection|array|null $items = []): Collection
return collect($items)->filter(function (MenuElement $item): bool {
if ($item instanceof MenuGroup) {
$item->setItems(
$item->items()->filter(
fn (MenuElement $child): bool => $child->isSee(moonshineRequest())
)
$this->prepareMenu($item->items())
);

$item->canSee(fn() => $item->items()->count() != 0);
}

return $item->isSee(moonshineRequest());
Expand Down

0 comments on commit 55a18c6

Please sign in to comment.