Snapshot of main at 9f39a6e1e (2026-11-02)
This commit is contained in:
commit
6ccf1792d7
2580 files changed
+1040202
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Calls;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class SendMessageButton extends Component
|
||||
{
|
||||
public $callable;
|
||||
public $call;
|
||||
|
||||
public function mount($callable, $call)
|
||||
{
|
||||
$this->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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user