server->name; } public function getSubNavigation(): array { $items = []; if (ServerView::canAccess()) { $items[] = NavigationItem::make(ServerView::getNavigationLabel()) ->icon('heroicon-o-chart-pie') ->isActiveWhen(fn () => request()->routeIs(ServerView::getRouteName())) ->url(ServerView::getUrl(parameters: ['server' => $this->server])); } if (SitesIndex::canAccess()) { $items[] = NavigationItem::make(SitesIndex::getNavigationLabel()) ->icon('heroicon-o-globe-alt') ->isActiveWhen(fn () => request()->routeIs(SitesIndex::getRouteName().'*')) ->url(SitesIndex::getUrl(parameters: ['server' => $this->server])); } if (DatabasesIndex::canAccess()) { $items[] = NavigationItem::make(DatabasesIndex::getNavigationLabel()) ->icon('heroicon-o-circle-stack') ->isActiveWhen(fn () => request()->routeIs(DatabasesIndex::getRouteName().'*')) ->url(DatabasesIndex::getUrl(parameters: ['server' => $this->server])); } if (PHPIndex::canAccess()) { $items[] = NavigationItem::make(PHPIndex::getNavigationLabel()) ->icon('heroicon-o-code-bracket') ->isActiveWhen(fn () => request()->routeIs(PHPIndex::getRouteName().'*')) ->url(PHPIndex::getUrl(parameters: ['server' => $this->server])); } if (LogsIndex::canAccess()) { $items[] = NavigationItem::make(LogsIndex::getNavigationLabel()) ->icon('heroicon-o-square-3-stack-3d') ->isActiveWhen(fn () => request()->routeIs(LogsIndex::getRouteName().'*')) ->url(LogsIndex::getUrl(parameters: ['server' => $this->server])); } if (ServerSettings::canAccess()) { $items[] = NavigationItem::make(ServerSettings::getNavigationLabel()) ->icon('heroicon-o-cog-6-tooth') ->isActiveWhen(fn () => request()->routeIs(ServerSettings::getRouteName().'*')) ->url(ServerSettings::getUrl(parameters: ['server' => $this->server])); } return $items; } protected function getHeaderWidgets(): array { return [ ServerSummary::make([ 'server' => $this->server, ]), ]; } protected static function getServerFromRoute(): ?Server { $server = request()->route('server'); if (! $server) { $server = Route::getRoutes()->match(Request::create(url()->previous()))->parameter('server'); } if ($server instanceof Server) { return $server; } if ($server) { return Server::query()->find($server); } return null; } public function getHeaderWidgetsColumns(): int|string|array { return 1; } }