@vite(['resources/css/app.css', 'resources/js/app.js']) @livewireStyles @php $user = auth()->user(); $metrics = app(\App\Services\UserDashboardMetrics::class); $usage = $metrics->usage($user); $sub = $metrics->subscription($user); $planName = $sub?->plan?->name ?? 'Free'; $unread = $metrics->unreadCount($user); $monthlyCap = $metrics->limits($user)['quotas']['posts_per_month']; $monthlyUsed = (int) ($usage->posts_month ?? 0); $monthlyPct = ($monthlyCap !== null && $monthlyCap > 0) ? min(100, round($monthlyUsed / $monthlyCap * 100)) : null; $initials = strtoupper(mb_substr($user?->name ?? $user?->email ?? '?', 0, 1)); // [route, label, icon, badge] $navGroups = [ 'Overview' => [ ['dashboard', 'Dashboard', 'layout-dashboard', null], ['user.analytics', 'Analytics', 'bar-chart-3', null], ['user.reports', 'Reports', 'file-text', null], ], 'Publishing' => [ ['user.automation', 'Automation', 'workflow', $user->automations()->count() ?: null], ['user.queue', 'Queue', 'list-checks', ($usage->queue ?? 0) ?: null], ['user.platforms', 'Platforms', 'layers', null], ['user.accounts', 'Accounts', 'share-2', $usage && is_array($usage->accounts) ? array_sum($usage->accounts) ?: null : null], ], 'Account' => array_values(array_filter([ ['billing', 'Billing', 'credit-card', null], $user->productEdition() === 'desktop' ? ['user.devices', 'License & Devices', 'monitor-smartphone', null] : null, ['user.notifications', 'Notifications', 'bell', $unread ?: null], ['profile', 'Settings', 'settings', null], ['user.support', 'Support', 'life-buoy', null], ])), ]; @endphp {{-- ============================ Sidebar ============================ --}} {{-- Mobile backdrop --}}
{{-- ============================ Content ============================ --}}
@if (session()->has('impersonator_id'))
You are impersonating {{ $user->email }}.
@csrf
@endif {{-- Header --}}
{{-- Global search --}}
{{-- Plan chip --}} {{-- Help --}} {{-- Bell --}} @if ($unread) {{ $unread }} @endif {{-- Profile --}}
Signed in as
{{ $user?->email }}
Profile Billing
@csrf
{{ $slot }}
{{-- Global toast (listens for Livewire dispatch('toast', message: '…', type: 'success')) --}}
@livewireScripts