@php $isAdminQuickActions = request()->routeIs('admin.*'); $quickSections = []; if ($isAdminQuickActions) { $quickSections = [ [ 'title' => 'NFC İşlemleri', 'items' => [ ['label' => 'Yeni NFC Oluştur', 'href' => route('admin.nfc-cards.create'), 'icon' => 'nfc'], ['label' => 'Tek Fiziki Kart Yazdır', 'href' => route('admin.card-stock.cards.create'), 'icon' => 'nfc'], ['label' => 'Çoklu Fiziki Kart Yazdır', 'href' => route('admin.card-stock.physical.index'), 'icon' => 'nfc'], ['label' => 'Kart Stokları', 'href' => route('admin.card-stock.index'), 'icon' => 'box'], ['label' => 'NFC / QR Kategorileri', 'href' => route('admin.nfc-categories.index'), 'icon' => 'tag'], ], ], [ 'title' => 'Müşteri ve Hesap', 'items' => [ ['label' => 'Yeni Bireysel Müşteri', 'href' => route('admin.customers.create', ['type' => 'person']), 'icon' => 'person'], ['label' => 'Yeni Bayi Müşteri', 'href' => route('admin.customers.create', ['type' => 'company']), 'icon' => 'building'], ['label' => 'Yetkili Kullanıcı Tanımla', 'href' => route('admin.business-users.create'), 'icon' => 'user-plus'], ['label' => 'Bireysel Kullanıcı Girişi', 'href' => route('admin.account-entry', ['accountType' => 'individual']), 'icon' => 'login'], ['label' => 'Bayi Kullanıcı Girişi', 'href' => route('admin.account-entry', ['accountType' => 'corporate']), 'icon' => 'login'], ], ], ]; $quickSections = array_merge($quickSections, app(\App\Services\AdminQuickCardActionsService::class)->sections()); } else { $quickUser = $user ?? auth('business')->user(); $quickIsCorporate = ($quickUser?->account_type ?? null) === 'corporate'; $panelItems = []; $accountItems = []; if ($quickIsCorporate && ($capabilities['nfc_create'] ?? false)) { $panelItems[] = ['label' => 'Yeni NFC Oluştur', 'href' => route('account.nfc.create'), 'icon' => 'nfc']; } if ($capabilities['nfc'] ?? false) { $panelItems[] = ['label' => 'NFC Kartlarım', 'href' => route('account.cards'), 'icon' => 'nfc']; } if (($capabilities['reports'] ?? false) || ($capabilities['digital_card'] ?? false)) { $panelItems[] = ['label' => 'Analiz & Raporlar', 'href' => route('account.reports'), 'icon' => 'chart']; } if ($capabilities['profile'] ?? false) { $accountItems[] = ['label' => 'Profilimi Düzenle', 'href' => route('account.profile'), 'icon' => 'person']; } if ($capabilities['subscription'] ?? false) { $accountItems[] = ['label' => 'Aboneliğim', 'href' => route('account.subscription'), 'icon' => 'package']; } if ($capabilities['security'] ?? false) { $accountItems[] = ['label' => 'Güvenlik', 'href' => route('account.security'), 'icon' => 'shield']; } if ($quickIsCorporate && ($capabilities['customers'] ?? false)) { $panelItems[] = ['label' => 'Müşteriler', 'href' => route('account.customers'), 'icon' => 'users']; if ($capabilities['customer_create'] ?? false) { $panelItems[] = ['label' => 'Yeni Müşteri Ekle', 'href' => route('account.customers.create'), 'icon' => 'user-plus']; } } if ($quickIsCorporate && ($capabilities['stock'] ?? false)) { $panelItems[] = ['label' => 'Stok Kartları', 'href' => route('account.stock-cards.index'), 'icon' => 'stack']; } if ($quickIsCorporate && ($capabilities['users'] ?? false)) { $panelItems[] = ['label' => 'Yetkili Kullanıcılar', 'href' => route('account.users'), 'icon' => 'users']; $panelItems[] = ['label' => 'Yeni Yetkili Kullanıcı', 'href' => route('account.users.create'), 'icon' => 'user-plus']; } if ($panelItems) $quickSections[] = ['title' => $quickIsCorporate ? 'Bayi Hızlı İşlemler' : 'Bireysel Hızlı İşlemler', 'items' => $panelItems]; // NFC kart kategorileri kullanıcıya atanmış gerçek kartlardan türetilir. // Boş stok kategorileri ve düzenlenemeyen merkezi kategoriler menüye girmez. if ($quickUser) { // On Dashboard, reuse the exact sections already calculated for its // Hızlı İşlemler cards. Other account pages calculate on demand. $cardSections = $quickCardActionSections ?? app(\App\Services\IndividualQuickCardActionsService::class) ->sections($quickUser, (bool) ($capabilities['digital_card'] ?? false)); $quickSections = array_merge($quickSections, $cardSections); } if ($accountItems) $quickSections[] = ['title' => 'Hesap', 'items' => $accountItems]; } @endphp @if(collect($quickSections)->pluck('items')->flatten(1)->isNotEmpty())