@php // Cross-page section navigation for the "where the money to run the business // came from" registers: shareholder Capital & Equity and job Funding are two // views of injected capital, so they share one tabbed workspace (mirrors // ). Each tab is a real route (its own full-page Livewire // component); wire:navigate gives the instant, no-reload feel of a single // tabbed page. Funding is reached through this control, which is why it no // longer appears as a separate sidebar link. Permission-gating mirrors the // sidebar: hide a tab the current user can't reach rather than 403 on it. $user = Auth::user(); $team = $user?->currentTeam; $allows = fn (string $perm): bool => (bool) ($team && $user->hasTeamPermission($team, $perm)); $tabs = array_values(array_filter([ ['route' => 'capital.index', 'pattern' => 'capital.*', 'label' => __('Capital & Equity'), 'icon' => 'scale-balance', 'show' => $allows('capital.read')], ['route' => 'funding.index', 'pattern' => 'funding.*', 'label' => __('Funding'), 'icon' => 'gift', 'show' => $allows('sponsorships.read')], ], fn ($t) => $t['show'])); @endphp
merge(['class' => 'no-scrollbar flex items-center gap-1 overflow-x-auto rounded-2xl bg-slate-100/80 p-1 ring-1 ring-slate-200/70']) }}> @foreach ($tabs as $tab) @php $active = request()->routeIs($tab['pattern']); @endphp $active, 'text-slate-500 hover:bg-white/70 hover:text-slate-800' => ! $active, ]) @if ($active) aria-current="page" @endif > {{ $tab['label'] }} @endforeach