Files
eatvio-infra/app/Livewire/Chat/LastUsers.php
2024-01-15 01:05:10 +03:00

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);
}
}