@extends('layouts.app') @section('title', 'Amigos - GIGAX ARENA') @section('page_title', 'Amigos') @section('content') @php $allFriends = collect($friends ?? []); $online = collect($onlineFriends ?? []); $inGame = collect($inGameFriends ?? $playingFriends ?? []); $offline = collect($offlineFriends ?? []); if ($allFriends->isEmpty()) { $allFriends = $inGame->concat($online)->concat($offline)->unique(function ($item) { return data_get($item, 'id') ?? data_get($item, 'user_id') ?? data_get($item, 'friend_id') ?? data_get($item, 'nickname') ?? data_get($item, 'name'); })->values(); } $received = collect($receivedRequests ?? $pendingReceived ?? $incomingRequests ?? []); $sent = collect($sentRequests ?? $pendingSent ?? $outgoingRequests ?? []); $totalFriends = $allFriends->count(); $onlineCount = $online->count(); $inGameCount = $inGame->count(); $receivedCount = $received->count(); $sentCount = $sent->count(); $friendId = function ($friend) { return data_get($friend, 'id') ?? data_get($friend, 'user_id') ?? data_get($friend, 'friend_id') ?? data_get($friend, 'friend_user_id'); }; $friendName = function ($friend) { return data_get($friend, 'nickname') ?? data_get($friend, 'name') ?? data_get($friend, 'username') ?? 'Jogador'; }; $statusOf = function ($friend) { $raw = strtolower((string) (data_get($friend, 'status') ?? data_get($friend, 'presence') ?? '')); if (in_array($raw, ['playing','in_game','ingame','em_partida','match'], true) || data_get($friend, 'in_game') || data_get($friend, 'is_playing')) return 'ingame'; if (in_array($raw, ['online','available','ativo'], true) || data_get($friend, 'online') || data_get($friend, 'is_online')) return 'online'; return 'offline'; }; @endphp
GIGAX ARENA

Lista completa de amigos

Busca, filtros, convites e acesso rápido sem dados fictícios.

Ir para o Lobby

Central de amigos

Filtre, busque e acesse as ações disponíveis.

@forelse($allFriends as $friend) @php $id = $friendId($friend); $name = $friendName($friend); $status = $statusOf($friend); $label = $status === 'ingame' ? 'Em partida' : ($status === 'online' ? 'Online agora' : 'Offline'); $avatar = data_get($friend,'avatar_url') ?? data_get($friend,'avatar') ?? data_get($friend,'photo'); $initial = function_exists('mb_substr') ? mb_strtoupper(mb_substr($name,0,1)) : strtoupper(substr($name,0,1)); @endphp @empty
Nenhum amigo cadastrado.
@endforelse
Nenhum amigo corresponde à busca.
@endsection @push('styles') @endpush @push('scripts') @endpush