@include('layout.header')
@if (liveMatchData()->count() != 0) @php $currentDateTime = now(); $activeMatches = \App\Models\MatchActivity::where('is_match_completed', 'N') ->where('match_start_time', '<=', $currentDateTime) ->where('match_approval_end_time', '>=', $currentDateTime) ->orderBy('match_start_time', 'asc') ->get(); $nextMatchExists = $activeMatches->contains(function ($match) { return in_array($match->match_type, ['semi_final', 'final']); }); if (!$nextMatchExists) { $upcomingMatch = \App\Models\MatchActivity::where('is_match_completed', 'N') ->where('match_start_time', '>', $currentDateTime) ->orderBy('match_start_time', 'asc') ->first(); $nextMatchExists = $upcomingMatch && in_array($upcomingMatch->match_type, ['semi_final', 'final']); } @endphp @foreach (liveMatchData()->toArray() as $index => $liveMatchData)
@if ($nextMatchExists)
@else
@endif @if (Auth::user()->user_type == 'BE' || Auth::user()->user_type == 'ABM') @if ($liveMatchData['match_end_time'] >= date('Y-m-d H:i:s')) @elseif ( \Carbon\Carbon::now()->between( \Carbon\Carbon::parse($liveMatchData['match_end_time']), \Carbon\Carbon::parse($liveMatchData['match_end_time'])->addHours(4)) && Auth::user()->user_access_grant == 'Y') @endif @endif

{{ 'Match ' . $liveMatchData['match_id'] }} Action Pending

{{ date('d M Y', strtotime($liveMatchData['match_start_time'])) }}

  • {{ $liveMatchData['team_name1'] }} {{ number_format($liveMatchData['team1_total_score'] / $liveMatchData['team_1_members'], 1) . ' (' . $liveMatchData['team_1_members'] . ') (' . $liveMatchData['team1_total_score'] . ' RX)' }}
  • {{ $liveMatchData['team_name2'] }} {{ number_format($liveMatchData['team2_total_score'] / $liveMatchData['team_2_members'], 1) . ' (' . $liveMatchData['team_2_members'] . ') (' . $liveMatchData['team2_total_score'] . ' RX)' }}
  • 99 days
  • 23 hours
  • 59 minutes
  • 59 seconds
@endforeach @else

Currently no matches are live now.

@endif
@include('layout.footer')