@extends('front.layouts.app') @section('content') @php $user = $user ?? null; $userRole = $userRole ?? ($user ? $user->role_slug : 'athlete'); $profile = $profile ?? (($userRole === 'team') ? ($user->teamProfile ?? null) : ($user->athleteProfile ?? null)); $location = $location ?? ''; $sportName = $sportName ?? ''; $positionName = $positionName ?? ''; $avatarImage = $avatarImage ?? asset('front/assets/images/user.jpeg'); $coverImage = $coverImage ?? asset('front/assets/images/cover.jpg'); $campaigns = $campaigns ?? collect(); $profileStats = $profileStats ?? [ 'matches' => 0, 'wins' => 0, 'followers' => 0, 'total_raised' => 0, 'active_campaigns' => 0, 'nfts_minted' => 0, 'supporters' => 0, ]; $nftTiers = $nftTiers ?? collect(); $otherUsers = $otherUsers ?? collect(); $otherUsersStats = $otherUsersStats ?? []; // Get bio $bio = optional($profile)->athlete_bio ?? optional($profile)->team_bio_tagline ?? 'No bio available'; // Get school/club name $schoolClub = optional($profile)->school_club_name ?? optional($profile)->team_club_name ?? 'N/A'; // Get social links $socialLinks = $user->socialLinks ?? collect(); $instagramLink = $socialLinks->where('social_link_type', 2)->first(); $facebookLink = $socialLinks->where('social_link_type', 3)->first(); $twitterLink = $socialLinks->first(function($link) { if ($link->social_link_type == 4) { $url = strtolower($link->social_link ?? ''); return strpos($url, 'twitter') !== false || strpos($url, 'x.com') !== false; } return false; }); // Get avatar or initials $avatarData = $user->avatar ?? []; $hasAvatar = isset($avatarData['id']) && $avatarData['id']; $avatar = $hasAvatar ? ($avatarData['original'] ?? $avatarData['thumb'] ?? asset('front/assets/images/user.jpeg')) : null; // Generate initials if no avatar $userInitials = ''; $initialColorType = 1; if (!$hasAvatar) { if ($user->name_initials) { $userInitials = strtoupper($user->name_initials); $initialColorType = $user->name_initial_color_type ?? 1; } else { $firstName = $user->first_name ?? ''; $lastName = $user->last_name ?? ''; $userInitials = strtoupper(mb_substr($firstName, 0, 1) . mb_substr($lastName, 0, 1)); $nameHash = crc32($user->full_name ?? ''); $initialColorType = ($nameHash % 8) + 1; } } // Format followers $followersFormatted = $profileStats['followers'] >= 1000 ? number_format($profileStats['followers'] / 1000, 1) . 'K' : $profileStats['followers']; // Check if verified $isVerified = $user->verified ?? false; // Get primary sport image $primarySport = $user->sports->first(); $sportImage = null; if ($userRole === 'team' && $profile && $profile->sport) { $sportImageData = optional($profile->sport)->image ?? []; if (is_array($sportImageData) && isset($sportImageData['original']) && is_string($sportImageData['original'])) { $sportImage = $sportImageData['original']; } } elseif ($userRole === 'athlete' && $primarySport && $primarySport->sport) { $sportImageData = optional($primarySport->sport)->image ?? []; if (is_array($sportImageData) && isset($sportImageData['original']) && is_string($sportImageData['original'])) { $sportImage = $sportImageData['original']; } } @endphp
{{ $sportName }} @if($positionName) - {{ $positionName }} @endif
@if($location){{ $location }}
@endif @if($userRole == 'athlete' && $schoolClub && $schoolClub !== 'N/A'){{ $schoolClub }}
@endif{{ $quote }}
{{ $bio }}
Matches / Events
Wins / Medals
Followers
Total Raised
Active Campaigns
NFTs Minted
Track & Field
Track & Field
{!! \App\Helpers\Helper::price($nftTier->nft_price) !!}
{{ $sold }} / {{ $total }} sold
{{ $profileStats['supporters'] }} supporters
Just finished training camp! Ready for the upcoming season.
Thank you to all my supporters who contributed to my campaign!
Identity confirmed
Campaign completion
Completed successfully
Impact delivered