@php $chatbot = App\Models\Chatbot\Chatbot::query() ->where('id', $settings_two->chatbot_template) ->first(); if (!$chatbot) { return; } $ipAddress = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : request()->ip(); $db_ip_address = App\Models\RateLimit::query()->where('ip_address', $ipAddress)->where('type', 'chatbot')->first(); $chatbot_history = App\Models\ChatBotHistory::query()->where('ip', $ipAddress)->first(); $position = $settings_two->chatbot_position ?? 'bottom-left'; $chatbot_custom_dimensions = ''; switch ($position) { case 'top-left': $trigger_class = 'top-10 start-10'; $chat_class = 'start-0 top-full'; break; case 'top-right': $trigger_class = 'top-10 end-12'; $chat_class = 'end-0 top-full'; break; case 'bottom-right': $trigger_class = 'bottom-10 end-10 lg:bottom-16'; $chat_class = 'end-0 bottom-full'; break; case 'bottom-left': $trigger_class = 'bottom-10 start-10 lg:bottom-16'; $chat_class = 'start-0 bottom-full'; break; } if ($chatbot->width || $chatbot->height) { $chatbot_custom_dimensions = sprintf('%s %s', $chatbot->width ? 'width:' . $chatbot->width . '!important;' : '', $chatbot->height ? 'height:' . $chatbot->height . '!important;' : ''); } @endphp
{{-- trigger --}} {{-- chat --}}