availableLenses($novaRequest) as $lens) { $count = $lens::criteria($model->newQuery())->count(); if ($count > 0) { // We are not using the helper function to avoid redundant authorization $lenses[] = MenuItem::make($lens->name()) ->path('/resources/'.$resourceClass::uriKey().'/lens/'.$lens->uriKey()) ->withBadge(Badge::make($count)); } } } $lensSection = MenuSection::make(__('nova.menu.main.section.lenses'), $lenses, 'video-camera') ->collapsedByDefault(); $menu->items[] = $lensSection; return $menu; }); // Enable breadcrumbs Nova::withBreadcrumbs(); // Disable the footer Nova::footer(fn () => ''); } /** * Register the Nova gate. * * This gate determines who can access Nova in non-local environments. * * @return void * * @noinspection PhpMissingParentCallCommonInspection */ protected function gate(): void { Gate::define('viewNova', fn (User $user) => $user->can(SpecialPermission::VIEW_NOVA->value)); } /** * Get the cards that should be displayed on the Nova dashboard. * * @return array * * @noinspection PhpMissingParentCallCommonInspection */ protected function dashboards(): array { return [ (new Main())->showRefreshButton(), ]; } }