@php $whatsappWebhookUrl = whatsapp_webhook_url(); $verifyToken = config('whatsapp.verify_token'); @endphp
WhatsApp (Click to chat / Cloud API) @if($whatsappConnections->isNotEmpty() && $whatsappConnections->first()->last_lead_at) Last lead: {{ format_date($whatsappConnections->first()->last_lead_at) }} @endif

One WhatsApp number can feed multiple projects. Add a Meta ad ID and/or message / menu option mapping per project. Unmatched leads use the default project. @if(config('whatsapp.leads_require_ctwa_referral')) Only leads from Click to WhatsApp ads are imported (organic chats are ignored). @endif

Verify token: use META_VERIFY_TOKEN / WHATSAPP_VERIFY_TOKEN in .env @if($verifyToken) ({{ $verifyToken }}) @endif — subscribe to messages.
@foreach($whatsappConnections as $connection)
Phone number ID {{ $connection->phone_number_id }} @if($connection->display_phone_number) {{ $connection->display_phone_number }} @endif
@csrf @method('DELETE')
@if($connection->waba_id)
WABA ID: {{ $connection->waba_id }}
@endif
Default project (fallback): {{ $connection->defaultProject?->name ?? '—' }} @if($connection->last_error)
{{ $connection->last_error }}
@endif
Project mappings

Campaign ID — one row for the whole campaign (recommended). Ad set ID — one row for all ads in that ad set. Message — exact menu / button text from WhatsApp. Campaign & ad set lookups need an active Meta Lead Ads page connection for this client.

@if($connection->mappings->isNotEmpty())
@foreach($connection->mappings as $mapping) @endforeach
Type Match key Project
{{ $mapping->typeLabel() }}
{{ $mapping->external_label ?? $mapping->external_key }}
{{ $mapping->external_key }}
{{ $mapping->project?->name ?? '—' }}
@csrf @method('DELETE')
@endif
@csrf
@endforeach
Add or update number
@csrf