@if(isset($buddies) && $buddies->isNotEmpty()) @foreach($buddies as $index => $buddyRequest) @php // Determine which user is the buddy (not the current user) $buddy = $buddyRequest->sender_user_id === auth()->id() ? $buddyRequest->receiver : $buddyRequest->sender; // Determine online/offline status $isOnline = $buddy->isOnline(); $statusClass = $isOnline ? 'online' : 'offline'; $statusTitle = $isOnline ? 'On' : 'Off'; // Get player service for the buddy $buddyPlayer = app(\OGame\Services\PlayerService::class, ['player_id' => $buddy->id]); // Get player statistics $highscoreService = app(\OGame\Services\HighscoreService::class); $playerRank = $highscoreService->getHighscorePlayerRank($buddyPlayer); $playerScore = $highscoreService->getPlayerScore($buddyPlayer); // Get homeworld coordinates $homeworldPlanet = $buddyPlayer->planets->first(); if ($homeworldPlanet) { $coords = $homeworldPlanet->getPlanetCoordinates(); } else { $coords = null; } // Row class for zebra striping $rowClass = $index % 2 === 0 ? 'odd' : 'even'; @endphp
No buddies found