@php
$breadcrumbs = [
'Chatbot FAQ' => ''
];
@endphp
@extends('layouts.master')
@section('title')
Chatbot FAQ Management
@endsection
@section('style')
@endsection
@section('content')
จัดการเมนูคำถามแนะนำแบบหลายชั้น (หัวข้อ → ตัวเลือกย่อย → คำตอบ) และไฟล์/ข้อความอ้างอิงที่ Chatbot ใช้ตอบคำถาม
@if($parent)
กำลังจัดการหัวข้อย่อยของ "{{ $parent->question }}" — ตัวเลือกในตารางนี้จะโชว์พร้อมกันตอนผู้ใช้เลือก "{{ $parent->question }}" ในแชท
@else
แถวในตารางนี้คือ "หัวข้อหลัก" ที่โชว์เป็นปุ่มตอนผู้ใช้เปิดแชทครั้งแรก — กด "ดูหัวข้อย่อย" ที่แถวไหนเพื่อจัดการตัวเลือกข้างในหัวข้อนั้น
@endif
🔗📄🖼️ = มีไฟล์/ลิงก์แนบอยู่
ระบบจะดึงข้อความในไฟล์มาทำดัชนีค้นหาอัตโนมัติ เก็บไว้เป็นข้อมูลอ้างอิงเท่านั้น (ยังไม่รองรับค้นข้อความในรูป) พิมพ์รายละเอียดเว็บ/บริการ ที่อยากให้บอทใช้ตอบ
Chatbot Knowledge Base
@forelse($faqs as $faq)
ลำดับ
หัวข้อ/คำถาม
คำตอบ
คีย์เวิร์ด
สถานะ
จัดการ
@empty
{{ $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
ลบ
@endforelse
ยังไม่มีข้อมูลในชั้นนี้
📄 อัปโหลด PDF
🖼️ อัปโหลดรูปภาพ
✍️ เพิ่มข้อความ
@forelse($documentGroups as $batchId => $chunks)
@php $first = $chunks->first(); @endphp
ประเภท
ชื่อ/หัวข้อ
จำนวนส่วน
อัปโหลดเมื่อ
จัดการ
@empty
{{ 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') }}
ลบ
@endforelse
ยังไม่มีไฟล์/ข้อมูลอัปโหลด