@vite(['resources/css/app.css', 'resources/js/app.js']) @livewireStyles
@php $badges = cache()->remember('admin.nav.badges', 30, fn () => [ 'users' => \App\Models\User::where('role', \App\Models\User::ROLE_CUSTOMER)->count(), 'payments' => \App\Models\Payment::where('status', \App\Models\Payment::STATUS_PENDING)->count() ?: null, // Badge the actionable signal the Notifications page surfaces: failed jobs. 'notifications' => \Illuminate\Support\Facades\DB::table('failed_jobs')->count() ?: null, 'tickets' => \App\Models\SupportTicket::where('status', \App\Models\SupportTicket::STATUS_OPEN)->count() ?: null, ]); $appVersion = \App\Models\SoftwareVersion::query()->orderByDesc('version_code')->value('version') ?? '2.4.0'; $mainNav = [ ['admin.dashboard', 'Dashboard', 'layout-dashboard', null, null], ['admin.users', 'Users', 'users', 'users.manage', $badges['users']], ['admin.devices', 'Device Management', 'monitor-smartphone', 'users.manage', null], ['admin.plans', 'Plans & Packages', 'credit-card', 'subscriptions.manage', null], ['admin.billing', 'Billing', 'bar-chart-3', 'billing.manage', null], ['admin.subscriptions', 'Subscriptions', 'refresh-ccw', 'subscriptions.manage', null], ['admin.invoices', 'Invoices', 'receipt', 'billing.manage', null], ['admin.payments', 'Payments', 'wallet', 'billing.manage', $badges['payments']], ['admin.refunds', 'Refunds', 'rotate-ccw', 'billing.manage', null], ['admin.coupons', 'Coupons', 'ticket', 'billing.manage', null], ['admin.taxes', 'Tax Rates', 'percent', 'billing.manage', null], ['admin.payment-methods', 'Payment Methods', 'wallet-cards', 'billing.manage', null], ['admin.accounts', 'Accounts', 'share-2', 'users.manage', null], ['admin.platforms', 'Platforms', 'layers', 'settings.manage', null], ['admin.automation', 'Automation', 'workflow', 'scheduler.manage', null], ['admin.queue', 'Queue Monitor', 'list-checks', 'queue.manage', null], ['admin.reports', 'Reports', 'file-text', 'reports.view', null], ['admin.health', 'System Health', 'heart-pulse', 'settings.manage', null], ['admin.staff', 'Staff Management', 'user-cog', 'manage-staff', null], ['admin.settings', 'Settings', 'settings', 'settings.manage', null], ]; $otherNav = [ ['admin.blog', 'Blog', 'newspaper', 'settings.manage', null], ['admin.pages', 'Pages', 'file-text', 'settings.manage', null], ['admin.support', 'Support Tickets', 'life-buoy', 'users.manage', $badges['tickets']], ['admin.notifications', 'Notifications', 'bell', null, $badges['notifications']], ['admin.activity', 'Audit Logs', 'scroll-text', 'activity.view', null], ['admin.software', 'Software Updates', 'download-cloud', 'software.manage', null], ]; $user = auth()->user(); $roleLabel = $user?->isSuperAdmin() ? 'Super Admin' : 'Staff'; $initials = strtoupper(mb_substr($user?->name ?? $user?->email ?? '?', 0, 1)); @endphp @php $navLink = function (array $item) { [$route, $label, $icon, $gate, $badge] = $item; return compact('route', 'label', 'icon', 'gate', 'badge'); }; @endphp {{-- ============================ Sidebar ============================ --}} {{-- Mobile backdrop --}} {{-- ============================ Content ============================ --}}