@php $audienceOptions = [ 'all' => ['label' => 'All active users', 'hint' => 'Every player whose account is not banned.'], 'selected_users' => ['label' => 'Selected users', 'hint' => 'Pick specific players by username.'], 'tournament_participants' => ['label' => 'Tournament participants', 'hint' => 'Players with a confirmed entry in one tournament.'], ]; $selectedTournament = $audienceType === 'tournament_participants' && $tournamentId ? $tournaments->firstWhere('id', (int) $tournamentId) : null; $selectedCount = $this->selectedUsers->count(); $audienceSummary = match ($audienceType) { 'all' => 'all active players', 'selected_users' => $selectedCount === 0 ? 'the players you select' : $selectedCount.' selected '.($selectedCount === 1 ? 'player' : 'players'), 'tournament_participants' => $selectedTournament ? 'the confirmed participants of "'.$selectedTournament->title.'"' : 'the participants of the tournament you choose', default => 'the chosen audience', }; @endphp
Selected ({{ $selectedCount }})
$title !== '', 'text-fg-3' => $title === ''])>{{ $title !== '' ? $title : 'Notification title' }}
$body !== '', 'text-fg-3' => $body === ''])>{{ $body !== '' ? $body : 'Your message will appear here.' }}