Initial commit
This commit is contained in:
33
app/Http/Livewire/Calls/SendMessageButton.php
Normal file
33
app/Http/Livewire/Calls/SendMessageButton.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
$conversation = getActiveProfile()->createConversationWith($this->callable);
|
||||
|
||||
return redirect()->route('chat', ['conversation' => $conversation->id]);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.calls.send-message-button');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user