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

34 lines
669 B
PHP

<?php
namespace App\Livewire\Chat;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class LastUsers extends Component
{
/**
* @var mixed
*/
public $lastChatUsers;
public int $activeUserId;
public int $curUserId;
public string $chanId;
public function render(): View|ViewFactory
{
return view('livewire.chat.last-users');
}
public function switchTo(int $id): void
{
$this->activeUserId = $id;
$this->dispatch('updateRecipientId', id: $id)->to('chat.message-window');
$this->redirectRoute('chat.show', $id);
}
}