@php use App\Models\LeagueRegistration; use App\Models\Player; use App\Models\PopularitySkill; $registration = $player->registration; $status = $registration ? (int) $registration->registration_status : null; $payment = $registration ? (int) $registration->payment_status : null; $genderLabel = match ((int) $player->gender) { Player::GENDER_MALE => 'Male', Player::GENDER_FEMALE => 'Female', Player::GENDER_OTHER => 'Other', default => '—', }; $paymentLabel = match ($payment) { LeagueRegistration::PAYMENT_COMPLETED => 'Paid', LeagueRegistration::PAYMENT_FAILED => 'Failed', LeagueRegistration::PAYMENT_REFUNDED => 'Refunded', LeagueRegistration::PAYMENT_PENDING => 'Pending', default => '—', }; $paymentBadge = $payment === LeagueRegistration::PAYMENT_COMPLETED ? 'verified' : 'pending'; $player_image = $player && $player->profile_image ? $player->profileImageUrl() : ($player->user?->profileImageUrl() ?? placeholder_image_url('player')); @endphp
{{-- PROFILE HEADER --}}
{{ $player->fullName() }}

{{ $player->fullName() }} @if ($player->is_verified) Verified @else Unverified @endif

@if ($player->playerCategory) {{ $player->playerCategory->name }} @endif {{ optional($player->playerRole)->name ?? '—' }} {{-- {{ $player->nationality ?? '—' }} --}} Base Price: {{ $player->formattedBasePrice() }}
Download PDF
{{-- QUICK STATS --}} {{--
Matches Played

{{ $player->matches_played ?? 0 }}

Runs Scored

{{ number_format((float) ($player->runs_scored ?? 0)) }}

Wickets Taken

{{ $player->wickets_taken ?? 0 }}

Catches

{{ $player->fielding_catches ?? 0 }}

--}} {{-- Social Reach --}}
Instagram Reach

{{ $player->instagram_reach ?: '—' }}

Facebook Reach

{{ $player->facebook_reach ?: '—' }}

TikTok Reach

{{ $player->tiktok_reach ?: '—' }}

{{-- MAIN GRID --}}
{{-- LEFT: personal + registration --}}

Personal Information

Full Name{{ $player->fullName() }}
{{--
Date of Birth{{ optional($player->date_of_birth)->format('d M Y') ?? '—' }}
--}}
Gender{{ $genderLabel }}
{{--
Nationality{{ $player->nationality ?? '—' }}
--}} {{--
Foreign Player{{ $player->is_foreign_player ? 'Yes' : 'No' }}
--}}
Batting Style{{ optional($player->battingStyle)->display_name ?? optional($player->battingStyle)->name ?? '—' }}
Bowling Style{{ optional($player->bowlingStyle)->display_name ?? optional($player->bowlingStyle)->name ?? '—' }}

Registration

Player ID#PL-{{ str_pad($player->id, 4, '0', STR_PAD_LEFT) }}
League{{ optional($player->league)->name ?? '—' }}
Category@if ($player->playerCategory){{ $player->playerCategory->name }}@else — @endif
Base Price{{ $player->formattedBasePrice() }}
Payment{{ $paymentLabel }}
Status@if ($status !== null){{ LeagueRegistration::statusLabel($status) }}@else — @endif
{{-- RIGHT: career stats + achievements --}}
{{--

Career Statistics

Batting
Bowling
Fielding
Average{{ $player->batting_average ?? '0.00' }}
Strike Rate{{ $player->batting_strike_rate ?? '0.00' }}
Highest Score{{ $player->highest_score ?? 0 }}
Centuries{{ $player->centuries ?? 0 }}
Half Centuries{{ $player->half_centuries ?? 0 }}
Fours{{ $player->fours ?? 0 }}
Sixes{{ $player->sixes ?? 0 }}
Not Outs{{ $player->not_outs ?? 0 }}
Average{{ $player->bowling_average ?? '0.00' }}
Economy{{ $player->bowling_economy ?? '0.00' }}
Strike Rate{{ $player->bowling_strike_rate ?? '0.00' }}
Best Bowling{{ $player->best_bowling ?? '—' }}
5 Wicket Hauls{{ $player->five_wicket_hauls ?? 0 }}
Overs Bowled{{ $player->overs_bowled ?? '0.0' }}
Maiden Overs{{ $player->maiden_overs ?? 0 }}
Runs Conceded{{ $player->runs_conceded ?? 0 }}
Catches{{ $player->fielding_catches ?? 0 }}
Run Outs{{ $player->run_outs ?? 0 }}
Stumpings{{ $player->stumpings ?? 0 }}
--}}

Popularity Skills

@if ($player->popularitySkills->isNotEmpty())
@foreach ($player->popularitySkills as $skill) {{ $skill->id === PopularitySkill::OTHER && filled($skill->pivot->other_text) ? $skill->pivot->other_text : $skill->name }} @endforeach
@else
No popularity skills selected.
@endif

Performances

@forelse ($player->performances as $perf)
{{ 'Performance' }} @if ($perf->is_best)Best@endif {{ (int) $perf->runs_scored }} runs · {{ (int) $perf->wickets_taken }} wkts · {{ (int) $perf->catches }} catches
@empty
No performances recorded yet.
@endforelse

Achievements

@forelse ($player->achievements as $achievement)
{{ $achievement->achievement_title }} {{ trim(($achievement->tournament_name ?? '') . ' ' . ($achievement->achievement_year ?? '')) ?: 'Achievement' }}
@empty
No achievements recorded yet.
@endforelse