@php /** @var \Illuminate\Support\Collection $broadcasts */ /** @var \Illuminate\Support\Collection $channels */ /** @var array $stats */ $statusPill = fn ($s) => match ($s) { 'sending' => ['bg-accent-amber/15 text-[#7B5A14]', __('Sending')], 'done' => ['bg-wa-mint text-wa-deep', __('Done')], 'failed' => ['bg-accent-coral/10 text-accent-coral', __('Failed')], default => ['bg-paper-100 text-ink-600', __('Draft')], }; @endphp
{{ __('LINE') }} · {{ __('Broadcasts') }}

{{ __('LINE') }} {{ __('broadcasts') }}

{{ __('Message everyone who has added and chatted with your LINE account, then track sent, failed and blocked per broadcast.') }}

{{ __('Channels') }} @unless ($channels->isEmpty()) {{ __('New broadcast') }} @endunless
@if (session('status') || session('success'))
{{ session('status') ?: session('success') }}
@endif @if (session('error') || $errors->any())
{{ session('error') ?: $errors->first() }}
@endif @if ($channels->isEmpty())
L

{{ __('Connect a LINE channel first.') }}

{{ __('Connect a channel') }}
@else {{-- KPI cards --}}
{{ __('Sent') }}
{{ number_format($stats['sent']) }}
{{ number_format($stats['total']) }} {{ __('broadcasts') }}
{{ __('Audience') }}
{{ number_format($stats['audience']) }}
{{ __('total recipients') }}
{{ __('Failed') }}
{{ number_format($stats['failed']) }}
{{ __('delivery errors') }}
{{ __('Blocked') }}
{{ number_format($stats['blocked']) }}
{{ __('blocked by user') }}
{{ __('Sending') }}
{{ number_format($stats['sending']) }}
{{ __('in flight') }}
{{-- Broadcast table --}}
{{ __('Broadcast list') }}

{{ __('Recent broadcasts') }}

@forelse ($broadcasts as $b) @php [$cls, $lbl] = $statusPill($b->status); @endphp @empty @endforelse
{{ __('Broadcast') }} {{ __('Channel') }} {{ __('Recipients') }} {{ __('Progress') }} {{ __('Status') }} {{ __('Actions') }}
{{ $b->name }}
{{ $b->created_at?->format('d M Y · H:i') }}
{{ $b->channel?->display_name ?: ($b->channel?->basic_id ?: '—') }} {{ number_format($b->total) }}
{{ $b->sent }} {{ __('sent') }} · {{ $b->failed }} {{ __('failed') }} · {{ $b->blocked }} {{ __('blocked') }}
{{ $lbl }}
@if (in_array($b->status, ['draft', 'sending'], true))
@csrf
@elseif ($b->status === 'failed' || ($b->failed + $b->blocked) > 0)
@csrf
@endif
@csrf @method('DELETE')
{{ __('No broadcasts yet.') }} {{ __('Create your first one') }}.
@endif