@extends('layouts.app') @section('title', 'Campaigns') @section('page', 'marketing') @php $statusVariant = fn ($s) => match ($s) { 'Sent' => 'success', 'Scheduled' => 'info', 'Draft' => 'warning', default => 'danger', }; @endphp @section('content') @if (session('success')) {{ session('success') }} @endif @if ($errors->any()) {{ $errors->first() }} @endif @if (($canManage ?? false) && ! ($smsReady ?? false)) SMS gateway is not configured. Open SMS Gateway settings to enable campaign sending. @endif @if ($canManage ?? false) @endif @forelse ($campaigns as $row) {{ $row->name }} {{ $row->smsTemplate?->name ?? 'Custom' }} {{ $row->audienceLabel() }} {{ $row->scheduled_at?->format('Y-m-d H:i') ?? '—' }} {{ $row->recipients_count }} {{ $row->sent_count }} {{ $row->status }}
@if ($row->status === 'Sent') @elseif ($canManage ?? false) @endif
@empty No campaigns yet.@if ($templates->isEmpty()) Create an SMS template first.@else Add your first campaign.@endif @endforelse
@if ($canManage ?? false) @endif @endsection @push('styles') @endpush @push('scripts') @endpush