@php $navItems = [ ['label' => 'داشبورد', 'route' => 'dashboard', 'icon' => 'home'], ['label' => 'تحلیل فروش', 'route' => 'dashboard.analytics', 'icon' => 'chart'], ['label' => 'شرکت‌های طرف قرارداد', 'route' => 'partner-companies.index', 'icon' => 'office', 'can' => ['viewAny', \App\Models\PartnerCompany::class]], ['label' => 'قراردادها', 'route' => 'contracts.index', 'icon' => 'document', 'can' => ['viewAny', \App\Models\Contract::class]], ['label' => 'پروژه‌ها', 'route' => 'projects.index', 'icon' => 'folder', 'can' => ['viewAny', \App\Models\Project::class]], ['label' => 'کاتالوگ', 'route' => 'catalog.index', 'icon' => 'tag', 'can' => ['viewAny', \App\Models\CatalogItem::class]], ['label' => 'مشتریان', 'route' => 'customers.index', 'icon' => 'users', 'can' => ['viewAny', \App\Models\Customer::class]], ['label' => 'فعالیت‌ها', 'route' => 'activities.index', 'icon' => 'calendar', 'can' => ['viewAny', \App\Models\Activity::class]], ['label' => 'وظایف', 'route' => 'tasks.index', 'icon' => 'calendar', 'can' => ['viewAny', \App\Models\Task::class]], ['label' => 'تارگت‌ها', 'route' => 'targets.index', 'icon' => 'users', 'can' => ['viewAny', \App\Models\Target::class]], ['label' => 'کمپین‌های پیامکی', 'route' => 'automation.campaigns.index', 'match' => 'automation.campaigns.*', 'icon' => 'briefcase', 'can' => ['viewAny', \App\Models\Campaign::class], 'automation' => true], ['label' => 'Workflowها', 'route' => 'automation.workflows.index', 'match' => 'automation.workflows.*', 'icon' => 'folder', 'can' => ['viewAny', \App\Models\Workflow::class], 'automation' => true], ['label' => 'گزارش ارسال پیامک', 'route' => 'automation.sms-logs', 'icon' => 'chart', 'can' => ['viewAny', \App\Models\AutomationSmsLog::class], 'automation' => true], ['label' => 'لیست سیاه پیامک', 'route' => 'automation.blacklist', 'icon' => 'tag', 'can' => ['viewAny', \App\Models\BlacklistEntry::class], 'automation' => true], ['label' => 'قالب‌های پیامک', 'route' => 'automation.sms-templates', 'icon' => 'document', 'can' => ['viewAny', \App\Models\SmsTemplate::class], 'automation' => true], ['label' => 'تیکت‌های پشتیبانی', 'route' => 'tickets.index', 'icon' => 'document', 'can' => ['viewAny', \App\Models\Ticket::class]], ['label' => 'پیش‌فاکتورها', 'route' => 'quotations.index', 'icon' => 'document', 'can' => ['viewAny', \App\Models\Quotation::class]], ['label' => 'توضیحات پیش‌فاکتور', 'route' => 'quotations.notes', 'icon' => 'document', 'can' => ['viewAny', \App\Models\QuotationNote::class]], ['label' => 'فروش‌ها', 'route' => 'deals.index', 'icon' => 'briefcase', 'can' => ['viewAny', \App\Models\Deal::class]], ['label' => 'پورسانت‌ها', 'route' => 'commissions.index', 'icon' => 'currency', 'can' => ['viewAny', \App\Models\CommissionEntry::class]], ['label' => 'تسویه‌ها', 'route' => 'settlements.index', 'icon' => 'currency', 'can' => ['viewAny', \App\Models\Settlement::class]], ['label' => 'گزارش‌ها', 'route' => 'reports.sales', 'icon' => 'chart', 'permission' => \App\Enums\PermissionEnum::ReportsView], ['label' => 'گزارش پشتیبانی', 'route' => 'reports.support', 'icon' => 'chart', 'permission' => \App\Enums\PermissionEnum::ReportsView], ['label' => 'مدیریت وب‌سایت', 'route' => 'cms.websites.index', 'icon' => 'document', 'can' => ['viewAny', \App\Models\Website::class]], ['label' => 'تنظیمات', 'route' => 'settings.workspace', 'icon' => 'cog', 'permission' => \App\Enums\PermissionEnum::WorkspaceSettingsManage], ]; $workspaceContext = app(\App\Support\WorkspaceContext::class); $automationEnabled = \App\Models\AutomationSetting::isEnabled(); @endphp @foreach ($navItems as $item) @php $enabled = Route::has($item['route']); $allowed = true; if (isset($item['can'])) { $allowed = \Illuminate\Support\Facades\Gate::allows($item['can'][0], $item['can'][1]); } elseif (isset($item['permission'])) { $allowed = $workspaceContext->can($item['permission']); } if (! empty($item['automation']) && ! $automationEnabled) { $allowed = false; } $visible = $enabled && $allowed; @endphp @continue(! $visible) request()->routeIs($item['match'] ?? $item['route'].'*'), 'border-transparent text-[var(--panel-muted)] hover:border-[var(--panel-border)] hover:bg-[var(--panel-surface)] hover:text-[var(--panel-primary)]' => ! request()->routeIs($item['match'] ?? $item['route'].'*'), ]) > {{ $item['label'] }} @endforeach {{-- Service-operator links. These are platform screens, not workspace ones — they live outside the 'workspace' middleware and render on their own layout — so they are kept visually separate rather than mixed into the workspace nav above. Shown only to platform admins, the same flag /admin itself enforces. Without this block the only route in was the profile menu, which never spells out what is behind it — someone looking for "بلاگ" in the sidebar found nothing. --}} @if (auth()->user()?->is_platform_admin)

مدیریت سامانه

@foreach ([ ['admin.requests', 'درخواست‌های دمو'], ['admin.accounts', 'کاربران سامانه'], ['admin.blog', 'بلاگ'], ] as [$route, $label]) @continue(! Route::has($route)) request()->routeIs($route), 'border-transparent text-[var(--panel-muted)] hover:border-[var(--panel-border)] hover:bg-[var(--panel-surface)] hover:text-[var(--panel-primary)]' => ! request()->routeIs($route), ]) > {{ $label }} @endforeach
@endif