@php $breadcrumbs = [ 'Chatbot FAQ' => '' ]; @endphp @extends('layouts.master') @section('title') Chatbot FAQ Management @endsection @section('style') @endsection @section('content')


Chatbot Knowledge Base

จัดการเมนูคำถามแนะนำแบบหลายชั้น (หัวข้อ → ตัวเลือกย่อย → คำตอบ) และไฟล์/ข้อความอ้างอิงที่ Chatbot ใช้ตอบคำถาม

@if(session('success'))
{{ session('success') }}
@endif
{{-- ============ TAB 1: FAQ ============ --}}
{{-- Breadcrumb: บอกว่าตอนนี้กำลังดูหัวข้อย่อยของอะไรอยู่ --}}

@if($parent) กำลังจัดการหัวข้อย่อยของ "{{ $parent->question }}" — ตัวเลือกในตารางนี้จะโชว์พร้อมกันตอนผู้ใช้เลือก "{{ $parent->question }}" ในแชท @else แถวในตารางนี้คือ "หัวข้อหลัก" ที่โชว์เป็นปุ่มตอนผู้ใช้เปิดแชทครั้งแรก — กด "ดูหัวข้อย่อย" ที่แถวไหนเพื่อจัดการตัวเลือกข้างในหัวข้อนั้น @endif   🔗📄🖼️ = มีไฟล์/ลิงก์แนบอยู่

@forelse($faqs as $faq) @empty @endforelse
ลำดับ หัวข้อ/คำถาม คำตอบ คีย์เวิร์ด สถานะ จัดการ
{{ $faq->order }} {{ $faq->question }} @if($faq->attachment_type === 'image') 🖼️ @elseif($faq->attachment_type === 'pdf') 📄 @elseif($faq->attachment_type === 'link') 🔗 @endif {{ $faq->answer ? \Illuminate\Support\Str::limit($faq->answer, 80) : '—' }} {{ $faq->keywords }} @if($faq->status === 'active') Active @else Inactive @endif ดูหัวข้อย่อย @if($faq->child_count) ({{ $faq->child_count }}) @endif ลบ
ยังไม่มีข้อมูลในชั้นนี้
{{-- ============ TAB 2: DOCUMENTS ============ --}}
📄 อัปโหลด PDF

ระบบจะดึงข้อความในไฟล์มาทำดัชนีค้นหาอัตโนมัติ

🖼️ อัปโหลดรูปภาพ

เก็บไว้เป็นข้อมูลอ้างอิงเท่านั้น (ยังไม่รองรับค้นข้อความในรูป)

✍️ เพิ่มข้อความ

พิมพ์รายละเอียดเว็บ/บริการ ที่อยากให้บอทใช้ตอบ

@forelse($documentGroups as $batchId => $chunks) @php $first = $chunks->first(); @endphp @empty @endforelse
ประเภท ชื่อ/หัวข้อ จำนวนส่วน อัปโหลดเมื่อ จัดการ
{{ strtoupper($first->type) }} {{ $first->title }} @if($first->file_path)
ดูไฟล์ต้นฉบับ @elseif($first->type === 'text')
@endif
{{ $chunks->count() }} {{ $first->created_at->format('d/m/Y H:i') }} ลบ
ยังไม่มีไฟล์/ข้อมูลอัปโหลด
{{-- Modal ดูเนื้อหาข้อความที่บันทึกไว้ (สำหรับรายการ type = text ที่ไม่มีไฟล์ต้นฉบับให้ดู) --}} {{-- Modal เพิ่ม/แก้ไข FAQ (custom, ไม่พึ่ง Bootstrap JS) --}}
@endsection