Central de amigos
Filtre, busque e acesse as ações disponíveis.
@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
Busca, filtros, convites e acesso rápido sem dados fictícios.
Filtre, busque e acesse as ações disponíveis.