@if ($messageHistories->count() > 1) Delete All @endif
{{ trans('whatsapp-gateway.table.no') }} {{ trans('Sender') }} {{ trans('Receive') }} {{ trans('Message') }} {{ trans('Status') }} {{ trans('Note') }} {{ trans('Time') }} {{ trans('From') }} {{ trans('whatsapp-gateway.table.action') }} @forelse ($messageHistories as $key => $messageHistory) @php $country_code = \App\Models\WhatsappGateway\WhatsappGatewayGeneral::first()->country_code; $customerName = preg_replace('/^' . $country_code . '?/', 0, $messageHistory['receiver'] ?? 0); $userAddress = \App\Models\UserAddress::wherePhone($customerName)->orWhere('phone', $messageHistory['receiver'])->first(); if ($userAddress) { $customerName = $userAddress->user->full_name; } else { $customerPaketAddress = \App\Models\Customers\CustomerPaketAddress::wherePhone($customerName)->orWhere('phone', $messageHistory['receiver'])->first(); if ($customerPaketAddress) $customerName = $customerPaketAddress->customer_paket->user->full_name; } @endphp {{ ($messageHistories->currentpage() - 1) * $messageHistories->perpage() + $loop->index + 1 }} {{ $messageHistory['device'] ?? '' }} {{ $customerName }} {{ $messageHistory['message'] ?? '' }} {{ $messageHistory['status'] == 4 ? 'Read' : ($messageHistory['status'] == 3 ? 'Sent' : ($messageHistory['status'] == 1 || $messageHistory['status'] == 2 ? 'Pending' : 'Unsent')) }} {{ $messageHistory['note'] ?? '' }} {{ $messageHistory['updated_at'] ?? '' }} {{ $messageHistory['send_from'] ?? '' }} @empty
{{ trans('Anda belum memiliki pesan') }}
@endforelse
@if ($messageHistories->hasPages())
{{ $messageHistories->links() }}
@endif