@php /** @var \App\Models\MetaCampaign $campaign */ $targeting = is_array($campaign->targeting ?? null) ? $campaign->targeting : []; $countries = is_array($targeting['countries'] ?? null) ? implode(', ', $targeting['countries']) : $targeting['countries'] ?? ''; $interests = is_array($targeting['interests'] ?? null) ? implode(', ', $targeting['interests']) : $targeting['interests'] ?? ''; $ageMin = $targeting['age_min'] ?? 18; $ageMax = $targeting['age_max'] ?? 45; $genderVal = $targeting['gender'] ?? ''; $metrics = $campaign->metrics; $statusLbl = ucfirst(strtolower($campaign->status)); $isActive = $campaign->status === 'ACTIVE'; @endphp
Meta Ads / Edit / {{ $campaign->facebook_id ?: '#' . $campaign->id }}
{{ __('Edit') }} {{ $campaign->name }}
@php $adCur = $adAccount?->currency ?? \App\Models\SystemSetting::get('default_currency', 'USD'); @endphp {{ $statusLbl }} / {{ number_format($metrics['clicks']) }} clicks / {!! \App\Support\FormatSettings::display($metrics['spend'], $adCur) !!} {{ __('spend') }}
@csrf @method('DELETE')
@csrf
@if ($errors->any())
{{ __('Could not save the campaign:') }}
    @foreach ($errors->all() as $msg)
  • {{ $msg }}
  • @endforeach
@endif
@csrf @method('PUT')
{{-- Live metrics from $campaign->metrics — populated by sync(). --}}
{{ __('Spend') }}
{!! \App\Support\FormatSettings::display($metrics['spend'], $adCur) !!}
{{ __('Impressions') }}
{{ number_format($metrics['impressions']) }}
{{ __('CTR') }}
{{ number_format($metrics['ctr'], 2) }}%
{{ __('Revenue') }}
{!! \App\Support\FormatSettings::display($metrics['revenue'], $adCur) !!}
01 {{ __('Campaign details') }} {{ __('editable') }}
@php $goal = old('optimization_goal', $campaign->optimization_goal); @endphp
{{ __('Changes apply after the next Meta sync.') }}
@php $st = old('status', $campaign->status); @endphp
@php $cta = old('ctwa_cta', $campaign->ctwa_cta ?? 'WHATSAPP_MESSAGE'); @endphp
02 {{ __('Audience targeting') }} {{ __('ad set') }}
@php $gen = old('gender', $genderVal); @endphp
03 {{ __('Ad creative') }} {{ __('live preview') }}