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

Gaming Tournaments

@auth @if(auth()->user()->canHostFreeTournaments()) Host Tournament @else Reach Level 3 to host tournaments @endif @else Login to Host @endauth
@auth
🌍 Global Tournaments 👥 Friends Only
@endauth
@auth @if(($filter ?? 'global') === 'friends')
👥 Showing tournaments hosted by your friends only

Switch to Global to see all tournaments, or find more friends.

@endif @endauth
@forelse($tournaments as $tournament)

{{ $tournament->title }}

{{ $tournament->game->name }}

by {{ $tournament->host->username }} @auth @if(auth()->user()->isFriendsWith($tournament->host)) Friend @endif @endauth
{{ strtoupper($tournament->type) }}
₦{{ number_format($tournament->prize_pool) }}
Prize Pool
{{ $tournament->participants->count() }}
Players
Entry Fee: ₦{{ number_format($tournament->entry_fee) }}
Status: {{ $tournament->status }}
@if($tournament->starts_at)
Starts: {{ $tournament->starts_at->format('M j, Y g:i A') }}
@endif
Created: {{ $tournament->created_at->diffForHumans() }}
@if($tournament->description)

Description:

{{ Str::limit($tournament->description, 150) }}

@endif
View Tournament @auth @if($tournament->canBeJoinedBy(auth()->user()))
@csrf
@elseif($tournament->users->contains(auth()->user()))
✓ You're participating in this tournament
@else
Tournament not available
@endif @else Login to Join @endauth
@auth @if($tournament->host_id !== auth()->id() && auth()->user()->hasPlayedWith($tournament->host) && !auth()->user()->isFriendsWith($tournament->host) && !auth()->user()->hasPendingRequestWith($tournament->host))
@csrf
@endif @endauth @if($tournament->livestream_link) @endif
@empty
🏆
@auth @if(($filter ?? 'global') === 'friends')

No Friend Tournaments

Your friends haven't hosted any tournaments yet.

@else

No Active Tournaments

Check back later or create your own tournament!

@if(auth()->user()->canHostFreeTournaments()) Host First Tournament @endif @endif @else

No Active Tournaments

Check back later or create your own tournament!

@endauth
@endforelse
@if($tournaments->hasPages())
{{ $tournaments->appends(request()->query())->links() }}
@endif
@endsection