@extends('layouts.admin') @section('page-title', 'Bulk SMS') @section('content')
{{-- Page Header --}}

Bulk SMS

Send targeted messages to your users and subscribers

New SMS Campaign
{{-- Stats Cards --}}

Total Sent

{{ number_format($stats['total']) }}

Draft

{{ number_format($stats['draft']) }}

Scheduled

{{ number_format($stats['scheduled']) }}

Delivered

{{ number_format($stats['sent']) }}

{{-- Main Card --}}
{{-- Card Header with Filters --}}

SMS Campaigns

@if(request('status')) Clear @endif
{{-- Table --}}
@forelse($messages as $sms) @empty @endforelse
Message Audience Recipients Status Delivery Scheduled Actions

{{ Str::limit($sms->message, 50) }}

{{ $sms->sender_id ? 'From: '.$sms->sender_id : 'Default Sender' }}

@php $targetIcons = [ 'all' => ['bg-blue-50', 'text-blue-600', 'M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.95 4.099 4.099 0 002.161-2.422c.173-.677-.072-1.342-.595-1.784a14.373 14.373 0 00-3.492-2.245c-.518-.286-.873-.708-1.06-1.168a3.724 3.724 0 01-.26-1.386c0-.965.446-1.828 1.143-2.39a7.653 7.653 0 013.657-1.424c.633-.1 1.094-.602 1.094-1.236v-.876a2.25 2.25 0 00-1.244-2.013L15.75 2.25a2.25 2.25 0 00-2.013 0l-1.5.75a2.25 2.25 0 01-2.013 0l-1.5-.75a2.25 2.25 0 00-2.013 0l-1.5.75a2.25 2.25 0 01-2.013 0l-1.5-.75a2.25 2.25 0 00-2.013 0L2.25 2.987A2.25 2.25 0 000 5.237v.876c0 .634.461 1.136 1.094 1.236a7.653 7.653 0 013.657 1.424c.697.562 1.143 1.425 1.143 2.39 0 .472-.093.928-.26 1.386-.187.46-.542.882-1.06 1.168a14.373 14.373 0 00-3.492 2.245c-.523.442-.768 1.107-.595 1.784a4.099 4.099 0 002.161 2.422 9.337 9.337 0 004.121.95 9.38 9.38 0 002.625-.372L12 21.75l1.5-.75a2.25 2.25 0 001.244-2.013V19.128z'], 'customers' => ['bg-emerald-50', 'text-emerald-600', 'M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.95 4.099 4.099 0 002.161-2.422c.173-.677-.072-1.342-.595-1.784a14.373 14.373 0 00-3.492-2.245c-.518-.286-.873-.708-1.06-1.168a3.724 3.724 0 01-.26-1.386c0-.965.446-1.828 1.143-2.39a7.653 7.653 0 013.657-1.424c.633-.1 1.094-.602 1.094-1.236v-.876a2.25 2.25 0 00-1.244-2.013L15.75 2.25a2.25 2.25 0 00-2.013 0l-1.5.75a2.25 2.25 0 01-2.013 0l-1.5-.75a2.25 2.25 0 00-2.013 0l-1.5.75a2.25 2.25 0 01-2.013 0l-1.5-.75a2.25 2.25 0 00-2.013 0L2.25 2.987A2.25 2.25 0 000 5.237v.876c0 .634.461 1.136 1.094 1.236a7.653 7.653 0 013.657 1.424c.697.562 1.143 1.425 1.143 2.39 0 .472-.093.928-.26 1.386-.187.46-.542.882-1.06 1.168a14.373 14.373 0 00-3.492 2.245c-.523.442-.768 1.107-.595 1.784a4.099 4.099 0 002.161 2.422 9.337 9.337 0 004.121.95 9.38 9.38 0 002.625-.372L12 21.75l1.5-.75a2.25 2.25 0 001.244-2.013V19.128z'], 'vendors' => ['bg-purple-50', 'text-purple-600', 'M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.361a1.125 1.125 0 01-.989-.565l-1.387-2.774A1.125 1.125 0 01.507 16.5V6.75a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0118.5 6.75v9.75a1.125 1.125 0 01-.507 1.005l-1.387 2.774a1.125 1.125 0 01-.989.565h-2.124z'], 'subscribers' => ['bg-rose-50', 'text-rose-600', 'M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75'], ]; $icon = $targetIcons[$sms->target_type] ?? $targetIcons['all']; @endphp {{ ucfirst($sms->target_type) }} {{ number_format($sms->total_recipients) }} @php $statusConfig = [ 'draft' => ['bg-gray-100', 'text-gray-700', 'M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931z', 'Draft'], 'scheduled' => ['bg-yellow-100', 'text-yellow-700', 'M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z', 'Scheduled'], 'sent' => ['bg-emerald-100', 'text-emerald-700', 'M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z', 'Sent'], 'failed' => ['bg-red-100', 'text-red-700', 'M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z', 'Failed'], ]; $cfg = $statusConfig[$sms->status] ?? $statusConfig['draft']; @endphp {{ $cfg[3] }}
@php $deliveryRate = $sms->total_recipients > 0 ? round(($sms->delivered_count / $sms->total_recipients) * 100) : 0; @endphp
{{ $deliveryRate }}%

{{ number_format($sms->sent_count) }} sent / {{ number_format($sms->delivered_count) }} delivered

@if($sms->scheduled_at) {{ $sms->scheduled_at->format('M d, Y') }}

{{ $sms->scheduled_at->format('H:i') }}

@else @endif
@if($sms->status === 'draft' || $sms->status === 'scheduled')
@csrf
@endif @if($sms->status === 'sent')
@endif
@csrf @method('DELETE')

No SMS campaigns yet

Create your first bulk SMS campaign to get started

Create Campaign
{{-- Pagination --}} @if($messages->hasPages())
{{ $messages->links() }}
@endif
@endsection