Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
// app/Http/Livewire/OnlineUsersList.php
namespace App\Http\Livewire;
use App\Services\PresenceService;
use Livewire\Attributes\On;
use Livewire\Component;
class OnlineUsersList extends Component
{
public $onlineUsers = [];
public $guard = 'web';
public $showCount = true;
public $showAvatars = true;
public $maxDisplay = 10;
public $refreshInterval = 10;
public function mount($guard = 'web', $showCount = true, $showAvatars = true, $maxDisplay = 10)
{
$this->guard = $guard;
$this->showCount = $showCount;
$this->showAvatars = $showAvatars;
$this->maxDisplay = $maxDisplay;
$this->loadOnlineUsers();
}
public function loadOnlineUsers()
{
try {
$presenceService = app(PresenceService::class);
$users = $presenceService->getOnlineUsers($this->guard);
// Limit the display count
$this->onlineUsers = $users->take($this->maxDisplay)->toArray();
} catch (\Exception $e) {
$this->onlineUsers = [];
}
}
public function render()
{
return view('livewire.online-users-list');
}
}