@php /** @var \Illuminate\Support\Collection $campaigns */ $campaigns = $campaigns ?? collect(); $statusCounts = $statusCounts ?? [ 'all' => 0, 'ACTIVE' => 0, 'PAUSED' => 0, 'SCHEDULED' => 0, 'DRAFT' => 0, 'FAILED' => 0, ]; $objectiveCounts = $objectiveCounts ?? []; $totals = $totals ?? ['total' => 0, 'active' => 0, 'spend' => 0, 'clicks' => 0]; $currentStatus = $currentStatus ?? 'all'; $currentObjective = $currentObjective ?? 'all'; $currentRange = $currentRange ?? 'all'; $currentSearch = $currentSearch ?? ''; $currentSort = $currentSort ?? 'date-desc'; $statuses = [ ['key' => 'all', 'label' => 'All campaigns', 'dot' => null, 'icon' => true], ['key' => 'ACTIVE', 'label' => 'Active', 'dot' => 'bg-wa-green'], ['key' => 'PAUSED', 'label' => 'Paused', 'dot' => 'bg-accent-amber'], ['key' => 'SCHEDULED', 'label' => 'Scheduled', 'dot' => 'bg-[#13478A]'], ['key' => 'DRAFT', 'label' => 'Drafts', 'dot' => 'bg-paper-200'], ['key' => 'FAILED', 'label' => 'Failed', 'dot' => 'bg-accent-coral'], ]; $objList = [ [ 'key' => 'all', 'label' => 'All objectives', 'icon' => ' ', ], ['key' => 'MESSAGES', 'label' => 'Messages', 'icon' => ''], ['key' => 'LINK_CLICKS', 'label' => 'Link clicks', 'icon' => ''], [ 'key' => 'LEAD_GENERATION', 'label' => 'Lead gen', 'icon' => '', ], [ 'key' => 'CONVERSIONS', 'label' => 'Conversions', 'icon' => '', ], [ 'key' => 'BRAND_AWARENESS', 'label' => 'Brand awareness', 'icon' => '', ], ]; @endphp
{{ __('Workspace — Bloomly') }}

{{ __('Meta Ads') }} {{ __('campaigns') }}

{{ __('Auto-refreshes every 5 minutes. Last sync') }} just now.

Analytics Create Meta campaign
{{ __('Total campaigns') }}
{{ $totals['total'] }}
{{ __('across all platforms') }}
{{ __('Active') }}
{{ $totals['active'] }}
{{ __('running now') }}
{{ __('Total spend') }}
@php $adCur = $adAccount?->currency ?? \App\Models\SystemSetting::get('default_currency', 'USD'); @endphp
{!! \App\Support\FormatSettings::display($totals['spend'], $adCur) !!}
{{ __('selected range') }}
{{ __('Total clicks') }}
{{ number_format($totals['clicks']) }}
{{ __('live insights') }}
{{-- Top filter / sort / live search — every control fires AJAX --}}
@include('user.campaigns._cards', compact('campaigns'))
@include('user.partials.pagination', [ 'paginator' => $campaigns, 'dataAttr' => 'data-meta-page', 'label' => 'campaigns', ])
{{ __('Help - 01') }}
{{ __('What is a Meta campaign?') }}

{{ __('A synced ad campaign from Meta Marketing API, including status, spend, clicks, objective, budget, and click-to-WhatsApp performance.') }}

{{ __('Help - 02') }}
{{ __('How should I read the filters?') }}

{{ __('Use All time for the full workspace view, then narrow to 7, 30, or 90 days when you need recent spend and click trends.') }}

{{ __('Help - 03') }}
{{ __('Which ads should I scale first?') }}

{{ __('Start with active message or lead campaigns that have steady clicks, controlled CPC, and replies coming into WhatsApp.') }}

{{-- ============================================================ Meta Ads — keys / connection modal. A small form, so it opens inline rather than on its own page (the /meta-ads/connect page stays as a deep-link fallback). Opened by the "Keys" button [data-open-keys] in the header, and auto-opened when the Create-gate redirects here with ?connect=1 or when saveKeys() validation fails ($errors). Submits to the SAME route as the standalone page. ============================================================ --}} @if ($connected) @endif