@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
Back to Discover
{{ strtoupper($userRole) }}
@if($hasAvatar && $avatar) {{ $user->full_name }} @else
{{ $userInitials }}
@endif @if($isVerified)
@endif

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

{{ $sportName }} @if($positionName) - {{ $positionName }} @endif

@if($location)

{{ $location }}

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

{{ $schoolClub }}

@endif
Follow Message Sponsor @if($userRole === 'team') Ask to Join @else Invite to Team @endif

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

@php $quote = optional($profile)->athlete_quote ?? optional($profile)->team_quote ?? '"Speed is my passion, excellence is my goal."'; if (!str_starts_with($quote, '"')) { $quote = '"' . $quote; } if (!str_ends_with($quote, '"')) { $quote = $quote . '"'; } @endphp

{{ $quote }}

{{ $bio }}

@if($twitterLink) @endif @if($instagramLink) @endif

Key Stats

{{ $profileStats['matches'] }}

Matches / Events

{{ $profileStats['wins'] }}

Wins / Medals

{{ $followersFormatted }}

Followers

{!! \App\Helpers\Helper::price($profileStats['total_raised']) !!}

Total Raised

{{ $profileStats['active_campaigns'] }}

Active Campaigns

{{ $profileStats['nfts_minted'] }}

NFTs Minted

Achievements & Highlights

2024 Regional MVP

All-State Player

Junior Nationals 2023

@if($userRole === 'athlete')

CURRENT TEAM

Stanford Athletics

Track & Field

PAST TEAMS

Oakland Youth Track

Track & Field

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

Digital Collectibles / NFTs

@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; $total = $nftTier->nft_quantity ?? 100; @endphp
@if($loop->first) @else @endif

{{ $nftTitle }}

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

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

Buy NFT
@endforeach
@endif

Fans & Supporters

{{ $profileStats['supporters'] }} supporters

JO
MH
SL
AR
TC
@if($profileStats['supporters'] > 5)
+{{ $profileStats['supporters'] - 5 }}
@endif

Posts & Updates

Just finished training camp! Ready for the upcoming season.

Thank you to all my supporters who contributed to my campaign!

Verified Profile

Identity confirmed

85% Success Rate

Campaign completion

4 Past Campaigns

Completed successfully

12 Goals Achieved

Impact delivered

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

Discover More {{ ucfirst($userRole) }}s

@foreach($otherUsers as $otherUser) @include('front.'.$_routePrefix.'.grid_list', ['user' => $otherUser, 'usersStats' => $otherUsersStats]) @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

Product Sponsor

Primary branding across all athlete materials and events

Cash Sponsor

Logo placement on uniforms and training gear

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

{{ $profileStats['supporters'] }} supporters have contributed so far.

@endsection