@extends('layouts.app') @section('title', 'Challenge Details') @section('content')

{{ $challenge->game->name }} Challenge

{{ ucfirst($challenge->status) }} {{ ucfirst($challenge->game->platform) }} Best of {{ $challenge->best_of }} {{ $challenge->created_at->diffForHumans() }}
₦{{ number_format($challenge->wager_amount * 2) }}
Total Prize Pool
₦{{ number_format($challenge->wager_amount) }} per player

Players

{{ substr($challenge->creator->username, 0, 1) }}

{{ $challenge->creator->username }}

Level {{ $challenge->creator->level }}
{{ number_format($challenge->creator->xp) }} XP
Creator
VS
@if($challenge->accepter)
{{ substr($challenge->accepter->username, 0, 1) }}

{{ $challenge->accepter->username }}

Level {{ $challenge->accepter->level }}
{{ number_format($challenge->accepter->xp) }} XP
Challenger
@else
?

Waiting for challenger

No one has accepted yet
@endif
@if($challenge->rules_text)

Challenge Rules

{{ $challenge->rules_text }}

@endif @if($challenge->status === 'accepted' || $challenge->status === 'completed' || $challenge->status === 'disputed')

Match Proofs

@if($challenge->matchProofs->count() > 0)
@foreach($challenge->matchProofs as $proof)
{{ $proof->user->username }} {{ $proof->created_at->diffForHumans() }}
@if($proof->file_url) Match proof @endif @if($proof->notes)

{{ $proof->notes }}

@endif
@endforeach
@else
📸

No match proofs uploaded yet

@endif
@endif @if($challenge->dispute)

Dispute Information

Opened by: {{ $challenge->dispute->openedBy->username }}

Reason: {{ $challenge->dispute->reason }}

Status: {{ ucfirst($challenge->dispute->status) }}

Opened: {{ $challenge->dispute->created_at->diffForHumans() }}

@endif

Actions

@auth @if($challenge->status === 'open' && $challenge->creator_id === auth()->id()) Invite Friends @endif @if($challenge->status === 'open' && $challenge->canBeAcceptedBy(auth()->user()))
@csrf
@endif @if($challenge->status === 'accepted' && ($challenge->creator_id === auth()->id() || $challenge->accepter_id === auth()->id())) @if(!$challenge->matchProofs->where('user_id', auth()->id())->count())
@csrf
@endif @if($challenge->status === 'accepted' && !$challenge->isCompleted() && !$challenge->isDisputed()) @php $userField = $challenge->creator_id === auth()->id() ? 'creator_claimed_result' : 'accepter_claimed_result'; $userClaim = $challenge->$userField; @endphp @if($userClaim === 'none')

🏆 Confirm Match Result

The match has been played. Please confirm the result:

💡 Note: Claiming "I Won" waits for opponent confirmation. Claiming "I Lost" immediately resolves the match.

@csrf
@csrf
@else

✅ You claimed: {{ $userClaim === 'win' ? 'Victory' : 'Defeat' }} @if($userClaim === 'win')
Waiting for opponent to confirm their result... @else
Match resolved! Your opponent wins by forfeit. @endif

@endif @endif @if($challenge->isDisputed() && $challenge->dispute && $challenge->bothClaimVictory()) @php $userIsCreator = $challenge->creator_id === auth()->id(); $evidenceField = $userIsCreator ? 'creator_evidence_path' : 'accepter_evidence_path'; $hasEvidence = !empty($challenge->dispute->$evidenceField); @endphp @if(!$hasEvidence)

⚠️ Evidence Required

Both players claim victory. Please upload evidence (screenshot/video) to resolve this dispute:

@csrf
@else

✅ Evidence uploaded successfully! @if($challenge->dispute->hasBothEvidence())
🔍 Admin has been notified and will review both evidences. @else
⏳ Waiting for opponent to upload their evidence. @endif

@endif @endif @if($challenge->status === 'accepted' && $challenge->matchProofs->count() >= 2 && !$challenge->isDisputed() && !$challenge->hasBothClaimedResults())
@csrf
@endif @endif @else

Login to participate in challenges

Login
@endauth

Challenge Details

Game: {{ $challenge->game->name }}
Platform: {{ ucfirst($challenge->game->platform) }}
Format: Best of {{ $challenge->best_of }}
Entry Fee: ₦{{ number_format($challenge->wager_amount) }}
Total Prize: ₦{{ number_format($challenge->wager_amount * 2 * 0.95) }}
Created: {{ $challenge->created_at->format('M j, Y') }}
@if($challenge->creator_game_username || $challenge->group_link || $challenge->group_id)

🎮 Join Game Information

@if($challenge->creator_game_username)
Creator's In-Game Username:
{{ $challenge->creator_game_username }}
@endif @if($challenge->group_link) @endif @if($challenge->group_id)
Group/Room ID:
{{ $challenge->group_id }}
@endif

💡 Tip: Use the information above to find and join the creator's game lobby or send them a friend request.

@endif
@endsection