@extends('layouts.app') @section('title', $campaign->name) @section('content')

{{ $campaign->name }}

{{ title_case_words($campaign->channel) }} ยท {{ $campaign->starts_on?->format('d M Y') ?: 'no start' }} โ€” {{ $campaign->ends_on?->format('d M Y') ?: 'ongoing' }}

Edit
@csrf
@csrf @method('DELETE')
@include('components.kpi', ['label' => 'Leads', 'value' => number_format($stats['leads']), 'variant' => 'info']) @include('components.kpi', ['label' => 'Conversions', 'value' => number_format($stats['conversions']), 'variant' => 'good']) @include('components.kpi', ['label' => 'Conversion rate', 'value' => $stats['convRate'].'%']) @include('components.kpi', ['label' => 'Revenue won', 'value' => money($stats['revenue']), 'variant' => 'good']) @include('components.kpi', ['label' => 'Cost per acquisition', 'value' => money($stats['cpa'])]) @include('components.kpi', ['label' => 'Return', 'value' => $stats['roi'].'%', 'variant' => $stats['roi'] > 0 ? 'good' : 'bad'])

Spend

Budget
{{ money($campaign->budget) }}
Spent
{{ money($campaign->spent) }}
Remaining
{{ money(max(0, $campaign->budget - $campaign->spent)) }}

Outcome

Revenue from converted customers
{{ money($stats['revenue']) }}
Net
{{ money($stats['revenue'] - $campaign->spent) }}
Status
{{ title_case_words($campaign->status) }}

Attribution

Leads are matched on the free-text campaign field equal to {{ $campaign->name }}.

Revenue is the sum of invoices raised for the customers those leads converted into โ€” not an assumed value per conversion.

Leads from this campaign

{{ $leads->total() }}
@if ($leads->isEmpty()) @include('components.empty-state', [ 'icon' => '★', 'title' => 'No leads attributed yet', 'message' => 'Capture a lead and set its campaign to "'.$campaign->name.'" to see it here.', ]) @else @foreach ($leads as $lead) @endforeach
LeadNamePhoneSource PriorityScoreStatusConverted
{{ $lead->lead_number }} {{ $lead->first_name }} {{ $lead->last_name }} {{ $lead->phone }} {{ title_case_words($lead->source) }} {{ title_case_words($lead->priority) }} {{ $lead->score }} {{ title_case_words($lead->status) }} {{ $lead->converted_at?->format('d M Y') ?: 'โ€”' }} Open
@endif
@if ($leads->hasPages())
{{ $leads->links('partials.pagination') }}
@endif
@endsection