forked from eatvio/eatvio-infra
31 lines
614 B
PHP
31 lines
614 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Chat;
|
|
|
|
use Livewire\Component;
|
|
use Illuminate\View\View;
|
|
use Illuminate\Support\Collection;
|
|
|
|
class LastUsers extends Component
|
|
{
|
|
public Collection $lastChatUsers;
|
|
|
|
public int|null $activeUserId = null;
|
|
|
|
public int $curUserId;
|
|
|
|
public string $chanId;
|
|
|
|
public function render(): View
|
|
{
|
|
return view('livewire.chat.last-users');
|
|
}
|
|
|
|
public function switchTo(int $id): void
|
|
{
|
|
$this->activeUserId = $id;
|
|
$this->dispatch('updateRecipientId', id: $id)->to('chat.message-window');
|
|
redirect()->route('chat.show', $id);
|
|
}
|
|
}
|