{{-- --}}
Action Pending
@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
@if ($nextMatchExists)
Semi Final /
Final Match
@else
Upcoming Match
@endif
Live Match
Team Leader Board
All Match