تعديل الرد التلقائي @php // 1. استخراج بيانات المرفقات العلنية $currentAttachmentType = old('attachment_type', $autoReply->attachment_type); $currentAttachmentMethod = old('attachment_method_radio', $autoReply->attachment_method ?? 'url'); $attachmentUrl = old('attachment_url', $autoReply->attachment_url); // 2. استخراج بيانات الرسائل المتقدمة $privateMessageSettings = $autoReply->private_message_settings ? json_decode($autoReply->private_message_settings, true) : []; $pmType = old('private_message_type', $privateMessageSettings['type'] ?? 'text'); $pmMediaMethod = old('private_message_media_method', $privateMessageSettings['media_method'] ?? 'url'); $pmMediaUrl = old('private_message_media_url', $privateMessageSettings['media_url'] ?? null); $pmQuickReplies = old('private_message_quick_replies', $privateMessageSettings['quick_replies'] ?? []); $pmButtons = old('private_message_buttons', $privateMessageSettings['buttons'] ?? []); // 3. استخراج بيانات الذكاء الاصطناعي (AI) $useAiReply = old('use_ai_reply', $autoReply->use_ai_reply ?? false); $aiProvider = old('ai_provider', $autoReply->ai_provider ?? 'openai'); $aiModel = old('ai_model', $autoReply->ai_model ?? null); $aiInstructions = old('ai_instructions', $autoReply->ai_instructions ?? ''); $aiContext = old('ai_context', $autoReply->ai_context ?? ''); $aiTemperature = old('ai_temperature', $autoReply->ai_temperature ?? 0.7); $aiMaxTokens = old('ai_max_tokens', $autoReply->ai_max_tokens ?? 300); $aiUseCommentContext = old('ai_use_comment_context', $autoReply->ai_use_comment_context ?? true); $aiFallbackMessage = old('ai_fallback_message', $autoReply->ai_fallback_message ?? null); // 4. استخراج بيانات فلترة الإساءة (تم الإصلاح هنا) $offensiveSettings = $autoReply->offensive_settings ? json_decode($autoReply->offensive_settings, true) : []; $enableFilter = old('enable_offensive_filter', $autoReply->enable_offensive_filter ?? false); $offensiveAction = old('offensive_action', $offensiveSettings['action'] ?? 'hide'); $offensiveReplyMessage = old('offensive_reply_message', $offensiveSettings['reply_message'] ?? ''); // منطق استرجاع الكلمات المسيئة بدقة $rawOffensiveKeywords = old('offensive_keywords', $offensiveSettings['keywords'] ?? []); if (is_string($rawOffensiveKeywords)) { // إذا كانت سلسلة نصية (JSON من قاعدة البيانات) $offensiveKeywords = json_decode($rawOffensiveKeywords, true) ?? []; } else { // إذا كانت مصفوفة (من old input) $offensiveKeywords = (array) $rawOffensiveKeywords; } // تنظيف المصفوفة وضمان وجود عنصر واحد فارغ على الأقل if (empty($offensiveKeywords)) { $offensiveKeywords = ['']; } // 5. استخراج بيانات الميزات الأخرى $preventDuplicates = old('prevent_duplicate_replies', $autoReply->prevent_duplicate_replies ?? true); $autoLikeComment = old('auto_like_comment', $autoReply->auto_like_comment ?? false); $hideComment = old('hide_comment_after_reply', $autoReply->hide_comment_after_reply ?? false); // 6. الكلمات المفتاحية للرد $triggerKeywords = old('keywords', $autoReply->keywords); if (is_string($triggerKeywords)) { $triggerKeywords = json_decode($triggerKeywords, true); } $triggerKeywords = (array) $triggerKeywords; if (empty($triggerKeywords) || (count($triggerKeywords) === 1 && empty($triggerKeywords[0]))) { $triggerKeywords = ['']; } @endphp

تعديل الرد التلقائي

تحديث إعدادات وخصائص الرد التلقائي

@if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf @method('PUT')
{{-- 1. المعلومات الأساسية --}}
المعلومات الأساسية
@error('name')
{{ $message }}
@enderror
@error('page_id')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
{{-- 2. إعدادات التفعيل --}}
إعدادات التفعيل
@error('trigger_type')
{{ $message }}
@enderror
@error('post_id')
{{ $message }}
@enderror
{{-- 3. رسائل الرد --}}
رسائل الرد
{{-- الرد العلني --}}
@error('reply_message')
{{ $message }}
@enderror
{{-- المرفقات العلنية --}}
إرفاق وسائط (اختياري)
@if ($autoReply->attachment_url && $autoReply->attachment_type && $currentAttachmentType != 'image' && $currentAttachmentType != 'video')

المرفق الحالي:

@if ($autoReply->attachment_type == 'image') @elseif ($autoReply->attachment_type == 'video') @endif
@endif
{{-- الذكاء الاصطناعي --}}
الرد الذكي (AI)
{{-- الرسائل الخاصة --}}
الرسائل الخاصة (اختياري)
@php $pmTypes = [ 'text' => ['label' => 'نص فقط', 'color' => 'text-gray-600', 'svg' => ''], 'image' => ['label' => 'صورة', 'color' => 'text-blue-500', 'svg' => ''], 'video' => ['label' => 'فيديو', 'color' => 'text-red-500', 'svg' => ''], 'quick_replies' => ['label' => 'ردود سريعة', 'color' => 'text-yellow-500', 'svg' => ''], 'buttons' => ['label' => 'أزرار', 'color' => 'text-green-500', 'svg' => ''], ]; @endphp @foreach($pmTypes as $key => $data) @endforeach
{{-- تم إزالة required هنا --}}
{{-- العمود الجانبي --}}
الإحصائيات

{{ $autoReply->reply_count }}

الردود

{{ $autoReply->getSuccessRate() }}%

نجاح
@if ($autoReply->last_used_at)
آخر استخدام: {{ $autoReply->last_used_at->diffForHumans() }} @endif
إعدادات متقدمة




إنشاء نسخة إلغاء
{{-- Modal Posts --}}