@if(!$authenticated)

INSURANCE HUB INDONESIA

Admin & AI Product Control Center

@if(session('error'))
{{ session('error') }}
@endif @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@foreach($errors->all() as $err)
• {{ $err }}
@endforeach
@endif
@csrf
Session Auth (.env) Gemini AI PDF Ready

Insurance Hub Indonesia • Portal Komparasi Asuransi & Direktori Agen Resmi.

@else @php $companiesPayload = $companies->map(function ($c) { return [ 'id' => $c->id, 'code' => $c->code, 'name' => $c->name, 'logoUrl' => $c->logo_url ?? '', 'ageMethod' => $c->age_method, 'active' => (bool) $c->is_active, 'products' => $c->products->map(function ($p) { return [ 'id' => $p->id, 'categoryId' => $p->category_id, 'slug' => $p->slug, 'name' => $p->name, 'tagline' => $p->tagline ?? '', 'category' => $p->brochure_code ?? '-', 'plansCount' => (int) ($p->plans_count ?? 0), 'benefitsCount' => (int) ($p->benefits_count ?? 0), 'summaryCount' => (int) ($p->summaries_count ?? 0), 'sourcePdf' => $p->source_pdf ?? 'Input PDF / Database', 'deductibleOptions' => $p->deductibleOptions->map(fn ($d) => [ 'tier_type' => (int) $d->tier_type, 'option_name' => $d->option_name, 'mechanism' => $d->mechanism, ])->values(), ]; })->values(), ]; })->values(); $categoriesPayload = $categories->map(function ($cat) { return [ 'id' => $cat->id, 'slug' => $cat->slug, 'name' => $cat->name, 'icon' => $cat->icon ?: 'fa-solid fa-shield-halved', 'desc' => $cat->description ?? '', ]; })->values(); $pendingAgentsPayload = $pendingAgents->map(function ($a) { return [ 'id' => $a->id, 'code' => $a->registration_code ?: ('AG-' . $a->id), 'date' => $a->created_at ? $a->created_at->format('d M Y') : '-', 'nama' => $a->name, 'perusahaan' => $a->company_name, 'agency' => $a->agency, 'posisi' => $a->position, 'kota' => $a->city, 'sejak' => $a->joined_year, 'aaji' => $a->aaji_number ?: '-', 'wa' => $a->whatsapp, 'email' => $a->email ?: '-', 'achievements' => is_array($a->achievements) ? $a->achievements : [], 'bio' => $a->bio ?: '-', 'status' => $a->status, ]; })->values(); $activeAgentsPayload = $activeAgents->map(function ($a) { return [ 'id' => $a->id, 'nama' => $a->name, 'perusahaan' => $a->company_name, 'posisi' => $a->position, 'agency' => $a->agency, 'kota' => $a->city, 'sejak' => $a->joined_year, 'wa' => $a->whatsapp, 'email' => $a->email ?: '', 'aaji' => $a->aaji_number ?: '', 'bio' => $a->bio ?: '', 'photo_url' => $a->photo_url ?? '', 'featured' => (bool) $a->is_featured, 'active' => (bool) $a->is_active, ]; })->values(); $leadsPayload = $leads->map(function ($l) { return [ 'id' => $l->id, 'time' => $l->created_at ? $l->created_at->format('d M, H:i') : '-', 'client' => $l->client_name, 'wa' => $l->whatsapp, 'type' => $l->topic, 'detail' => $l->detail ?? '-', 'agent' => $l->agent ? ($l->agent->name . ' (' . $l->agent->company_name . ')') : 'Umum / Belum Ditentukan', 'status' => $l->status, ]; })->values(); $auditLogsPayload = $auditLogs->map(function ($log) { return [ 'time' => $log->created_at ? $log->created_at->format('d M Y, H:i') : '-', 'admin' => $log->admin_name, 'action' => $log->action, ]; })->values(); $visitorLogsPayload = isset($visitorLogs) ? $visitorLogs->map(function ($vl) { return [ 'session_id' => $vl->session_id, 'is_bot' => (bool) ($vl->is_bot ?? false), 'month_period' => $vl->month_period, 'year' => (string) $vl->year, 'month_code' => (string) $vl->month_code, 'is_live' => (bool) $vl->is_live, 'period_flag' => is_array($vl->period_flag) ? $vl->period_flag : json_decode($vl->period_flag ?? '[]', true), 'date_formatted' => $vl->date_formatted, 'datetime_formatted' => $vl->datetime_formatted, 'event_type' => $vl->event_type, 'action_label' => $vl->action_label, 'ip_address' => $vl->ip_address, 'location_source' => $vl->location_source ?? 'ip', 'city' => $vl->city, 'region' => $vl->region, 'latitude' => (float) $vl->latitude, 'longitude' => (float) $vl->longitude, 'device_type' => $vl->device_type, 'browser_name' => $vl->browser_name, 'operating_system' => $vl->operating_system, 'referrer_url' => $vl->referrer_url ?? '-', 'current_url' => $vl->current_url, 'room_type_id' => $vl->room_type_id, 'room_name' => $vl->room_name ?? '-', 'utm_source' => $vl->utm_source, 'utm_medium' => $vl->utm_medium, 'utm_campaign' => $vl->utm_campaign, 'browsing_duration' => $vl->browsing_duration ?? '1m 00s', 'order_index' => (int) $vl->order_index, 'funnel_step' => $vl->funnel_step, 'payment_choice' => $vl->payment_choice, 'payment_status' => $vl->payment_status ?? 'drop_off', ]; })->values() : []; $knowledgePayload = isset($knowledgeBases) ? $knowledgeBases->map(function ($kb) { return [ 'id' => $kb->id, 'company_code' => $kb->company_code ?: 'GENERAL', 'company_name' => $kb->company_name ?: 'Aturan Umum (Global)', 'product_category' => $kb->product_category ?? '', 'product_name' => $kb->product_name ?? '', 'category' => $kb->category, 'rule_key' => $kb->rule_key, 'rule_title' => $kb->rule_title, 'ai_instruction' => $kb->ai_instruction, 'customer_explanation' => $kb->customer_explanation ?? '', 'is_active' => (bool) $kb->is_active, 'updated_at' => $kb->updated_at ? $kb->updated_at->format('d M Y, H:i') : '-', ]; })->values() : []; @endphp

Dashboard & Comparison Analytics

Timeframe Period:
Wizard

Simulasi Plan Rawat Inap

312

Wilayah Terpopuler: Indonesia (46%)

AI Compare

Analisa PDF & Saran Objektif

{{ $stats['ai_compare_users'] ?? 0 }}

Pengguna Tombol Saran: {{ $stats['ai_compare_clicks'] ?? 0 }} Total Klik

Leads (DB)

Permintaan Konsultasi Agent

{{ $stats['total_leads'] }}

Belum Ditindaklanjuti: {{ $stats['new_leads'] }} Baru

Onboarding

Antrean Verifikasi AAJI

{{ $stats['pending_agents'] }}

Target SLA: < 24 Jam Kerja

Directory

Best Agent Aktif

{{ $stats['active_agents'] }}

Featured Beranda: {{ $stats['featured_agents'] }} / 6 Slot

Products

Produk & Plan Terdaftar

{{ $stats['total_products'] }} Produk / {{ $stats['total_plans'] }} Plan

Kategori Aktif: {{ $stats['total_categories'] }} Kategori

Interaction & Simulation Volume Trends

Rawat Inap vs Penyakit Kritis

Antrean Verifikasi Agent

AAJI Check
@endif