@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 ?? []; $supporters = $profileStats['supporters'] ?? 0; $followers = $profileStats['followers'] ?? 0; $totalRaised = $profileStats['total_raised'] ?? ($totalRaised ?? 0); $activeCampaigns = $profileStats['active_campaigns'] ?? ($activeCampaigns ?? 0); $nftsMinted = $profileStats['nfts_minted'] ?? 0; $nftTiers = $nftTiers ?? collect(); $otherUsers = $otherUsers ?? collect(); $followersFormatted = $followers >= 1000 ? number_format($followers / 1000, 1) . 'K' : (string) $followers; // Get bio $bio = optional($profile)->athlete_bio ?? optional($profile)->team_bio_tagline ?? 'No bio available'; // Get school/club name $schoolClub = optional($user)->school_club_name ?? optional($profile)->team_club_name ?? optional($profile)->school_club_name ?? 'N/A'; // Get social links $socialLinks = $user->socialLinks ?? collect(); // Get gender icon $genderIcon = ''; if ($userRole === 'athlete' && isset($user->gender)) { $genderIcon = $user->gender == 1 ? asset('front/assets/images/male.svg') : asset('front/assets/images/female.svg'); } $userTypeBadge = ($userRole === 'team') ? asset('front/assets/images/team.png') : asset('front/assets/images/athelete.png'); $authUserId = auth()->id(); $discoverConversationId = ($authUserId && $user) ? \App\Models\Users\Message::discoverConversationId($authUserId, $user->id) : 0; $loggedInUserRole = $loggedInUserRole ?? (auth()->check() && auth()->user() ? auth()->user()->role_slug : null); $hasPendingInvite = $hasPendingInvite ?? false; $hasAcceptedInvite = $hasAcceptedInvite ?? false; @endphp
{{ $user->full_name ?? 'Athlete' }}
{{ ucfirst($userRole)}}

{{ ($userRole === 'team') ? $schoolClub : ($user->full_name ?? 'Athlete Name') }}

{{ $sportName }}{{ $positionName ? ' - ' . $positionName : '' }}

@if($location)

{{ $location }}

@endif @if($userRole == 'athlete' && $schoolClub && $schoolClub !== 'N/A')

{{ $schoolClub }}

@endif
@php $followState = $followState ?? 'none'; $isFollowing = ($followState === 'active'); $isRequested = ($followState === 'pending'); @endphp Message Sponsor @if(in_array($loggedInUserRole, ['athlete', 'team']) && $loggedInUserRole !== $userRole) @if($userRole === 'team') @if($hasAcceptedInvite) Joined @elseif($hasPendingInvite) Request Sent @else Ask to Join @endif @else @if($hasAcceptedInvite) Joined @elseif($hasPendingInvite) Request Sent @else Invite to Team @endif @endif @endif

Messages with {{ ($userRole === 'team') ? $schoolClub : ($user->full_name ?? 'User') }}

No messages yet. Start the conversation!

{{ substr(($userRole === 'team') ? $schoolClub : ($user->full_name ?? 'U'), 0, 2) }}

About {{ ($userRole === 'team') ? $schoolClub : ($user->first_name ?? 'Athlete') }}

{{ $bio }}

@foreach($socialLinks as $socialLink) @php $socialIcon = ''; $socialUrl = $socialLink->social_link_url ?? '#'; switch($socialLink->social_link_type) { case 1: $socialIcon = asset('front/assets/images/youtube.png'); break; case 2: $socialIcon = asset('front/assets/images/instagram.png'); break; case 3: $socialIcon = asset('front/assets/images/facebook1.png'); break; case 4: $socialIcon = asset('front/assets/images/twitter1.png'); break; case 5: $socialIcon = asset('front/assets/images/link.png'); break; } @endphp @if($socialIcon) Social Link @endif @endforeach

Achievements

Statistics

38

Matches / Events

{{ number_format($supporters) }}

supporters

{{ $followersFormatted }}

Followers

{!! \App\Helpers\Helper::price($totalRaised) !!}

Total Raised

{{ number_format($activeCampaigns) }}

Active Campaigns

{{ number_format($nftsMinted) }}

NFTs Minted

@if($nftTiers->count() > 0)

Digital Collectibles

@foreach($nftTiers as $nftTier) @php $campaign = $nftTier->campaign ?? null; $campaignImage = asset('front/assets/images/placeholder-campaign.jpg'); if ($campaign && isset($campaign->campaign_image)) { $imgData = is_array($campaign->campaign_image) ? $campaign->campaign_image : []; $campaignImage = $imgData['original'] ?? $imgData['thumb'] ?? $campaignImage; } $nftTitle = 'NFT Tier'; if (isset($nftTier->rewards_perks_note)) { $lines = explode("\n", $nftTier->rewards_perks_note); if (isset($lines[0]) && strpos($lines[0], 'Title:') === 0) { $nftTitle = str_replace('Title: ', '', $lines[0]); } } $sold = 0; // TODO: Get actual sold count $total = $nftTier->nft_quantity ?? 100; @endphp
{{ $nftTitle }}

{{ $nftTitle }}

{!! \App\Helpers\Helper::price($nftTier->nft_price) !!}

{{ $sold }}/{{ $total }} Sold

Buy NFT
@endforeach
@endif @if($otherUsers->count() > 0)

Discover More Athletes / Teams

@foreach($otherUsers as $otherUser) @include('front.discover.grid_list', ['user' => $otherUser]) @endforeach
@endif
@if($campaigns->count() > 0)

Active Fundraising Campaigns

@foreach($campaigns as $campaign) @php $campaignProgress = $campaign->fund_target > 0 ? ($campaign->fund_raised / $campaign->fund_target) * 100 : 0; $campaignProgress = min(100, max(0, $campaignProgress)); $sportIcon = asset('front/assets/images/ball.png'); if ($campaign->category && isset($campaign->category->image)) { $catImg = is_array($campaign->category->image) ? ($campaign->category->image['thumb'] ?? $campaign->category->image['original'] ?? '') : ''; if ($catImg) { $sportIcon = $catImg; } } @endphp
{{ $campaign->title }}
Click here to contribute
@endforeach
@endif

Sponsors & Partners

@php $acceptedSponsorships = $acceptedSponsorships ?? collect(); @endphp @forelse($acceptedSponsorships as $sponsorship) @php $sponsor = $sponsorship->sponsor ?? null; $sponsorName = $sponsor ? ($sponsor->full_name ?? $sponsor->first_name . ' ' . $sponsor->last_name) : 'Sponsor'; $offerTypeName = $sponsorship->offer_type_name ?? 'Sponsor'; $fundingAmount = $sponsorship->funding_amount ?? 0; $offerTitle = $sponsorship->offer_title ?? $offerTypeName; @endphp

{{ $offerTypeName }}

{{ $offerTitle }}

{{ $sponsorName }} · {!! \App\Helpers\Helper::price($fundingAmount) !!}

@empty

No Sponsors or Partners

No sponsorship or partnership agreements at this time. Check back later or reach out to become a sponsor.

@endforelse

Team Roster

@php $teamRoster = $teamRoster ?? collect(); @endphp @forelse($teamRoster as $invite) @php $member = $invite->invitedUser ?? null; $memberName = $member ? ($member->full_name ?? trim($member->first_name . ' ' . $member->last_name) ?: 'Team Member') : 'Team Member'; $memberAvatar = $member && isset($member->avatar) ? (is_array($member->avatar) ? ($member->avatar['thumb'] ?? $member->avatar['original'] ?? '') : $member->avatar) : ''; $memberUrl = $member && !empty($member->username) ? route('front.discover.show', $member->username) : null; @endphp
@if($memberAvatar) {{ $memberName }} @else @endif

{{ $memberName }}

Team Member

@if($memberUrl) View profile @endif
@empty

No Team Roster

No team roster at this time. Check back later or reach out to become a team member.

@endforelse

Support {{ ($userRole == 'team') ? $schoolClub ?? 'Athlete' : ($user->first_name ?? 'Athlete') }}

1,240 supporters have contributed so far.

@endsection @push('page_script') @endpush