callable = $callable; $this->call = $call; } public function createConversation() { if (!$this->callable || $this->callable->isRemoved()) { return; } $activeProfile = getActiveProfile(); $conversation = $activeProfile->createConversationWith($this->callable); $locale = $activeProfile->lang_preference ?? app()->getLocale(); $firstName = explode(' ', trim($this->callable->name ?? ''))[0]; $callTitle = $this->call->tag?->translation?->name ?? $this->call->tag?->name ?? ''; $prefillMessage = __('Hello :name,', ['name' => $firstName], $locale) . "\n" . __('About your :title call, ', ['title' => $callTitle], $locale); return redirect()->route('chat', ['conversation' => $conversation->id, 'prefill' => $prefillMessage]); } public function render() { return view('livewire.calls.send-message-button'); } }