@php
use Filament\Enums\DatabaseNotificationsPosition;
use Filament\Enums\GlobalSearchPosition;
use Filament\Enums\UserMenuPosition;
use Filament\Livewire\GlobalSearch;
use Filament\Support\Facades\FilamentView;
use Filament\Support\Icons\Heroicon;
use Filament\View\PanelsIconAlias;
use Filament\View\PanelsRenderHook;
@endphp
@php
$isRtl = __('filament-panels::layout.direction') === 'rtl';
$isSidebarCollapsibleOnDesktop = filament()->isSidebarCollapsibleOnDesktop();
$isSidebarFullyCollapsibleOnDesktop = filament()->isSidebarFullyCollapsibleOnDesktop();
$hasTopNavigation = filament()->hasTopNavigation();
$hasNavigation = filament()->hasNavigation();
$hasTenancy = filament()->hasTenancy();
@endphp
{{ FilamentView::renderHook(PanelsRenderHook::TOPBAR_START) }}
@if ($hasNavigation)
@endif
@if ($isSidebarCollapsibleOnDesktop || $isSidebarFullyCollapsibleOnDesktop)
@endif
{{ FilamentView::renderHook(PanelsRenderHook::TOPBAR_LOGO_BEFORE) }}
@if ($homeUrl = filament()->getHomeUrl())
@else
@endif
{{ FilamentView::renderHook(PanelsRenderHook::TOPBAR_LOGO_AFTER) }}
@if ($hasTopNavigation || (! $hasNavigation))
@if ($hasTenancy && filament()->hasTenantMenu())
@endif
@if ($hasNavigation)
@php
$navigation = filament()->getNavigation();
@endphp
@foreach ($navigation as $group)
@php
$groupLabel = $group->getLabel();
$groupExtraTopbarAttributeBag = $group->getExtraTopbarAttributeBag();
$isGroupActive = $group->isActive();
$groupIcon = $group->getIcon();
@endphp
@if ($groupLabel)
{{ $groupLabel }}
@php
$lists = [];
foreach ($group->getItems() as $item) {
if ($childItems = $item->getChildItems()) {
$lists[] = [
$item,
...$childItems,
];
$lists[] = [];
continue;
}
if (empty($lists)) {
$lists[] = [$item];
continue;
}
$lists[count($lists) - 1][] = $item;
}
if (empty($lists[count($lists) - 1])) {
array_pop($lists);
}
@endphp
@foreach ($lists as $list)
@foreach ($list as $item)
@php
$isItemActive = $item->isActive();
$itemBadge = $item->getBadge();
$itemBadgeColor = $item->getBadgeColor($itemBadge);
$itemBadgeTooltip = $item->getBadgeTooltip($itemBadge);
$itemUrl = $item->getUrl();
$itemIcon = $isItemActive ? ($item->getActiveIcon() ?? $item->getIcon()) : $item->getIcon();
$shouldItemOpenUrlInNewTab = $item->shouldOpenUrlInNewTab();
$itemExtraAttributes = $item->getExtraAttributeBag();
@endphp
{{ $item->getLabel() }}
@endforeach
@endforeach
@else
@foreach ($group->getItems() as $item)
@php
$isItemActive = $item->isActive();
$itemActiveIcon = $item->getActiveIcon();
$itemBadge = $item->getBadge();
$itemBadgeColor = $item->getBadgeColor($itemBadge);
$itemBadgeTooltip = $item->getBadgeTooltip($itemBadge);
$itemIcon = $item->getIcon();
$shouldItemOpenUrlInNewTab = $item->shouldOpenUrlInNewTab();
$itemUrl = $item->getUrl();
$itemExtraAttributes = $item->getExtraAttributeBag();
@endphp
{{ $item->getLabel() }}
@endforeach
@endif
@endforeach
@endif
@endif
{{ FilamentView::renderHook(PanelsRenderHook::GLOBAL_SEARCH_BEFORE) }}
@if (filament()->isGlobalSearchEnabled() && filament()->getGlobalSearchPosition() === GlobalSearchPosition::Topbar)
@livewire(GlobalSearch::class)
@endif
{{ FilamentView::renderHook(PanelsRenderHook::GLOBAL_SEARCH_AFTER) }}
@if (filament()->auth()->check())
@if (filament()->hasDatabaseNotifications() && filament()->getDatabaseNotificationsPosition() === DatabaseNotificationsPosition::Topbar)
@livewire(filament()->getDatabaseNotificationsLivewireComponent(), [
'lazy' => filament()->hasLazyLoadedDatabaseNotifications(),
])
@endif
@if (filament()->hasUserMenu() && filament()->getUserMenuPosition() === UserMenuPosition::Topbar)
@endif
@endif
{{ FilamentView::renderHook(PanelsRenderHook::TOPBAR_END) }}