@extends('SuperAdmin.layout.layout') @section('body') @php $owner = session('owner'); $hasSmsAccess = false; if ($owner && isset($owner['id'])) { $tenant = \App\Models\Tenant::find($owner['id']); $hasSmsAccess = $tenant && $tenant->sms_access; } @endphp @if(!$hasSmsAccess)

SMS Access Denied

SMS access is not enabled for your account.

Return to Dashboard
@else

SMS Dashboard

Open SMS Messaging
Conversations

{{ $conversationCount ?? 0 }}

Inbound

{{ $inboundCount }}

Outbound

{{ $outboundCount }}

Failed

{{ $failedCount }}

Unanswered

{{ $unansweredCount ?? 0 }}

Inbound Messages
@if($inboundMessages->isEmpty())

No inbound messages

@else
@foreach($inboundMessages as $msg) @endforeach
From Customer Message Date
{{ $msg->formatted_from ?? $msg->from_phone }} @include('SuperAdmin.Sms.partials.dashboard-customer-cell', [ 'dashboardCustomer' => $msg->dashboard_customer, 'customerName' => $msg->dashboard_customer_name, 'customerEmail' => $msg->dashboard_customer_email, 'fallbackPhone' => $msg->from_phone, ]) {{ Str::limit($msg->message, 60) }} {{ tenant_datetime($msg->created_at, 'M j, Y g:i A') }}
@endif
Outbound Messages (Sent/Delivered)
@if($outboundMessages->isEmpty())

No outbound messages

@else
@foreach($outboundMessages as $msg) @endforeach
To Customer Message Status Source Date
{{ $msg->formatted_to ?? $msg->to_phone }} @include('SuperAdmin.Sms.partials.dashboard-customer-cell', [ 'dashboardCustomer' => $msg->dashboard_customer, 'customerName' => $msg->dashboard_customer_name, 'customerEmail' => $msg->dashboard_customer_email, 'fallbackPhone' => $msg->to_phone, ]) {{ Str::limit($msg->message, 60) }} {{ $msg->status }} @if($msg->send_mode === 'auto') Auto @elseif($msg->send_mode === 'manual') Manual @else @endif {{ tenant_datetime($msg->created_at, 'M j, Y g:i A') }}
@endif
Automatic Messages
@if(empty($automaticMessages) || $automaticMessages->isEmpty())

No automatic messages

@else
@foreach($automaticMessages as $msg) @endforeach
To Customer Message Status Date
{{ $msg->formatted_to ?? $msg->to_phone }} @include('SuperAdmin.Sms.partials.dashboard-customer-cell', [ 'dashboardCustomer' => $msg->dashboard_customer, 'customerName' => $msg->dashboard_customer_name, 'customerEmail' => $msg->dashboard_customer_email, 'fallbackPhone' => $msg->to_phone, ]) {{ Str::limit($msg->message, 60) }} @if($msg->status === 'failed') failed @elseif($msg->status === 'delivered') delivered @else {{ $msg->status }} @endif {{ tenant_datetime($msg->created_at, 'M j, Y g:i A') }}
@endif
Conversations
@if(empty($conversations))

No conversations yet

@else
@foreach($conversations as $conv) @endforeach
Phone Customer Last message Direction Unread Updated
{{ $conv['formatted_phone'] ?? $conv['phone'] }} @include('SuperAdmin.Sms.partials.dashboard-customer-cell', [ 'dashboardCustomer' => $conv['customer'] ?? null, 'customerName' => $conv['customer_name'] ?? null, 'customerEmail' => $conv['customer_email'] ?? null, 'fallbackPhone' => $conv['phone'] ?? '', ]) {{ Str::limit($conv['last_message'] ?? '', 80) }} @if(($conv['last_direction'] ?? '') === 'incoming') Incoming @else Outgoing @endif {{ $conv['unread_count'] ?? 0 }} {{ tenant_datetime($conv['last_message_at'] ?? null, 'M j, Y g:i A') }}
@endif
Failed Messages
@if($failedMessages->isEmpty())

No failed messages

@else
@foreach($failedMessages as $msg) @endforeach
To / From Customer Message Error Source Date
{{ $msg->direction === 'outgoing' ? ($msg->formatted_to ?? $msg->to_phone) : ($msg->formatted_from ?? $msg->from_phone) }} @include('SuperAdmin.Sms.partials.dashboard-customer-cell', [ 'dashboardCustomer' => $msg->dashboard_customer, 'customerName' => $msg->dashboard_customer_name, 'customerEmail' => $msg->dashboard_customer_email, 'fallbackPhone' => $msg->direction === 'outgoing' ? $msg->to_phone : $msg->from_phone, ]) {{ Str::limit($msg->message, 50) }} {{ Str::limit($msg->error_message ?? $msg->status_message ?? '—', 40) }} @if($msg->direction === 'outgoing') @if($msg->send_mode === 'auto') Auto @elseif($msg->send_mode === 'manual') Manual @else @endif @else @endif {{ tenant_datetime($msg->created_at, 'M j, Y g:i A') }}
@endif
Unanswered Conversations
@if(empty($unansweredConversations))

No unanswered conversations

@else
@foreach($unansweredConversations as $conv) @endforeach
Phone Customer Last Client Message Received At
{{ $conv['formatted_phone'] ?? $conv['phone'] }} @include('SuperAdmin.Sms.partials.dashboard-customer-cell', [ 'dashboardCustomer' => $conv['customer'] ?? null, 'customerName' => $conv['customer_name'] ?? null, 'customerEmail' => $conv['customer_email'] ?? null, 'fallbackPhone' => $conv['phone'] ?? '', ]) {{ Str::limit($conv['last_message'] ?? '', 80) }} {{ tenant_datetime($conv['last_message_at'] ?? null, 'M j, Y g:i A') }}
@endif
@endif @endsection @section('custom-scripts') @endsection