{{-- ── Left rail ─────────────────────────────────────────────── --}} {{-- ── Main ──────────────────────────────────────────────────── --}}

{{ __('WhatsApp') }} / {{ __('Groups') }}

{{ __('Group') }} {{ __('messaging') }}

{{ __('Create WhatsApp groups from your business number, share the invite link, and handle join requests. Conversations appear in your inbox like any other chat.') }}

@if (session('status'))
{{ session('status') }}
@endif @error('group')
{{ $message }}
@enderror @if (! $account)

{{ __('No WhatsApp Business number connected') }}

{{ __('Groups need a WhatsApp number connected through the official WhatsApp Business Platform.') }}

{{ setup_hint('devices') }}

@elseif (! $eligible) {{-- Meta returns 131215 for any number that is not an Official Business Account. Nothing on this page can work, so say why plainly instead of showing controls that will fail. --}}

{{ __('This number cannot use groups yet') }}

{{ __('WhatsApp only opens the Groups feature to Official Business Accounts — the verified tier with the green badge. Your number is connected and working for normal chats; it just has not been granted group access.') }}

{{ __('Apply for Official Business Account status in WhatsApp Manager, then reload this page.') }}

@else {{-- KPI strip --}}
@foreach ([ ['label' => __('Groups'), 'value' => $stats['total'], 'sub' => __('on this number')], ['label' => __('Members'), 'value' => $stats['participants'], 'sub' => __('across all groups')], ['label' => __('Join requests'), 'value' => $stats['pending'], 'sub' => __('waiting for you')], ['label' => __('Suspended'), 'value' => $stats['suspended'], 'sub' => __('blocked by WhatsApp')], ] as $kpi)

{{ $kpi['label'] }}

{{ number_format($kpi['value']) }}

{{ $kpi['sub'] }}

@endforeach
{{-- Create --}}

{{ __('Create a group') }}

@csrf

{{ __('What members see at the top of the chat. Up to 128 characters.') }}

{{ __('Approval gives you a queue to review before anyone is let in.') }}

{{ __('Optional. Shown on the group info screen.') }}

{{-- List --}}

{{ __('Your groups') }}

@forelse ($groups as $g) @php $pending = (array) ($g->meta_json['join_requests'] ?? []); @endphp

{{ $g->subject ?: __('Untitled group') }}

{{ trans_choice('{0}No members|{1}1 member|[2,*]:count members', $g->participant_count, ['count' => number_format($g->participant_count)]) }} @if ($g->join_approval_mode === 'approval_required') ·{{ __('approval required') }} @endif

@if ($g->suspended)

{{ __('WhatsApp has suspended this group. You cannot message it until they restore it.') }}

@endif
@csrf
@csrf @method('DELETE')
{{-- Invite link. Absent is a REAL state, not an error: Meta issues it on a webhook moments after create. --}}
@if ($g->awaitingInviteLink()) {{ __('Invite link is being created by WhatsApp…') }} @else {{ $g->invite_link }} @endif
@csrf
@if ($pending)

{{ __('Waiting to join') }}

@foreach ($pending as $jid => $jr)
{{ $jr['wa_id'] ?? $jid }}
@endforeach
@endif
@empty

{{ __('No groups yet. Create one above to get started.') }}

@endforelse
@endif