@if($resource != null) @if($data->channel == 'Whatsapp' && $data->type == 'Message') @php $data2 = $data->whatsapp->user_id; $checks = \App\Models\Tenant\Whatsapp::where('user_id',$data2)->get(); @endphp @foreach($checks as $check) @foreach($check->messages as $message) @if($message->type == 'Inbound')
@if($resource != null)

{{ $check->created_at->format('D H:i A') }}

@endif
mdo
@if($message->attachment != null) The browser does not support it, click on it to download @else {{ $message->text }} @endif

{{$message->created_at->format('D h:i A')}}

@else

{{$message->user != null ? $message->user->first_name . " " .$message->user->last_name :""}}

@if($message->attachment != null) attachment) }}" alt="{{$message->attachment}}" height="90px">

{{ $message->text }}

@else {{ $message->text }} @endif

{{$message->created_at->format('M d, y h:i A')}}

@endif @endforeach @endforeach @foreach($data->whatsapp->messages as $message) @if($message->type == 'Inbound')
mdo
@if($message->attachment != null) @if($message->media_type == 'audio/ogg; codecs=opus') @elseif($message->media_type == 'video/mp4')

{{ $message->text }}

@elseif($message->media_type == 'application/pdf') attachment) }}" download> attachment) }}" type="application/pdf" width="100%" height="100%">

Alternative text - include a link attachment) }}">to the PDF!

@elseif($message->media_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ) attachment) }}" download> @elseif( $message->media_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') attachment) }}" download> @else attachment) }}" target="_blank" > attachment) }}" alt="{{$message->attachment}}" width="320" >

{{ $message->text }}

@endif @else {{ $message->text }} @endif

{{$message->created_at->format('D h:i A')}}

@else

{{$message->user != null ? $message->user->first_name . " " .$message->user->last_name :""}}

@if($message->attachment != null) @if($message->media_type == 'audio/ogg; codecs=opus') @elseif($message->media_type == 'video/mp4')

{{ $message->text }}

@elseif($message->media_type == 'application/pdf' ) attachment) }}" download> attachment) }}" type="application/pdf" width="100%" height="100%">

Alternative text - include a link attachment) }}">to the PDF!

@elseif($message->media_type == 'application/vnd.openxmlofficedocument.wordprocessingmlformats-.document' ) attachment) }}" download> @elseif( $message->media_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') attachment) }}" download> @else attachment) }}" target="_blank" > attachment) }}" alt="{{$message->attachment}}" width="320" >

{{ $message->text }}

@endif @else {{ $message->text }} @endif

{{$message->created_at->format('D h:i A')}}

@endif @endforeach @elseif($data->channel == 'Whatsapp' && $data->type == 'Cm') @php $data2 = $data->whatsapp->user_id; $checks = \App\Models\Tenant\Whatsapp::where('user_id',$data2)->get(); @endphp @foreach($checks as $check) @foreach($check->messages as $message) @if($message->type == 'Inbound')
@if($resource != null)

{{ $check->created_at->format('D H:i A') }}

@endif
mdo
@if($message->attachment != null) The browser does not support it, click on it to download @else {{ $message->text }} @endif

{{$message->created_at->format('D h:i A')}}

@else

{{$message->user != null ? $message->user->first_name . " " .$message->user->last_name :""}}

@if($message->attachment != null) attachment) }}" alt="{{$message->attachment}}" height="90px">

{{ $message->text }}

@else {{ $message->text }} @endif

{{$message->created_at->format('M d, y h:i A')}}

@endif @endforeach @endforeach @foreach($data->whatsapp->messages as $message) @if($message->type == 'Inbound')
mdo
@if($message->attachment != null) @if($message->media_type == 'audio/ogg; codecs=opus') @elseif($message->media_type == 'video/mp4')

{{ $message->text }}

@elseif($message->media_type == 'application/pdf')

Alternative text - include a link to the PDF!

@elseif($message->media_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ) @elseif( $message->media_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') @else {{$message->attachment}}

{{ $message->text }}

@endif @else {{ $message->text }} @endif

{{$message->created_at->format('D h:i A')}}

@else

{{$message->user != null ? $message->user->first_name . " " .$message->user->last_name :""}}

@if($message->attachment != null) @if($message->media_type == 'audio/ogg; codecs=opus') @elseif($message->media_type == 'video/mp4')

{{ $message->text }}

@elseif($message->media_type == 'application/pdf' ) attachment) }}" download> attachment) }}" type="application/pdf" width="100%" height="100%">

Alternative text - include a link attachment) }}">to the PDF!

@elseif($message->media_type == 'application/vnd.openxmlofficedocument.wordprocessingmlformats-.document' ) attachment) }}" download> @elseif( $message->media_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') attachment) }}" download> @else attachment) }}" target="_blank" > attachment) }}" alt="{{$message->attachment}}" width="320" >

{{ $message->text }}

@endif @else {{ $message->text }} @endif

{{$message->created_at->format('D h:i A')}}

@endif @endforeach @elseif($data->channel == 'Livechat') @php $data2 = $data->livechat->username; $ip_address = $data->livechat->ip_address; $checks = \App\Models\Tenant\LiveChat::where('ip_address', $ip_address) ->where('id','!=', $data->livechat->id) ->get(); @endphp @foreach($checks as $check) @foreach($check->messages as $message) @if($message->type == 'Inbound')
@if($resource != null)

{{ $check->created_at->format('D H:i A') }}

@endif
mdo
@if($message->attachment != null) {{-- The browser does not support it, click on it to download --}} Click to view the attachment {{ $message->message }} @else {{ $message->message }} @endif

{{$message->created_at->format('D h:i A')}}

@else

{{$check->resourceInfo->resource->user_id != 0 ? $check->resourceInfo->resource->user->first_name . " " .$check->resourceInfo->resource->user->last_name :""}}

@if($message->attachment != null) {{-- attachment) }}" alt="{{$message->attachment}}" height="90px"> --}} attachment) }}" target="_blank" rel="noopener noreferrer" style="display: block;">Click to view the attachment

{{ $message->message }}

@else {{ $message->message }} @endif

{{$message->created_at->format('M d, y h:i A')}}

@endif @endforeach @endforeach @foreach($data->livechat->messages as $message) @if($loop->index == 0) @else @if($message->type == 'Inbound')
mdo
@if($message->attachment != null) @if($message->mime_type == 'audio/ogg; codecs=opus') @elseif($message->mime_type == 'video/mp4')

{{ $message->text }}

@elseif($message->mime_type == 'application/pdf') attachment) }}" download> attachment) }}" type="application/pdf" width="100%" height="100%">

Alternative text - include a link attachment) }}">to the PDF!

@elseif($message->mime_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ) attachment) }}" download> @elseif( $message->mime_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') attachment) }}" download> @else attachment) }}" target="_blank" > attachment) }}" alt="{{$message->attachment}}" width="320" >

{{ $message->message }}

@endif @else {{ $message->message }} @endif

{{$message->created_at->format('D h:i A')}}

@else

{{$data->resource->user_id != 0 ? $data->resource->user->first_name:""}}

@if($message->attachment != null) @if($message->mime_type == 'audio/ogg; codecs=opus') @elseif($message->mime_type == 'video/mp4')

{{ $message->text }}

@elseif($message->mime_type == 'application/pdf' ) attachment) }}" download> attachment) }}" type="application/pdf" width="100%" height="100%">

Alternative text - include a link attachment) }}">to the PDF!

@elseif($message->mime_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ) attachment) }}" download> @elseif( $message->mime_type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') attachment) }}" download> @else attachment) }}" target="_blank" > attachment) }}" alt="{{$message->attachment}}" width="320" >

{{ $message->message }}

@endif @else {{ $message->message }} @endif

{{$message->created_at->format('D h:i A')}}

@endif @endif @endforeach @endif @endif