@include('partials.main-chart-box.chart-box-top-section') @if ($selectedUser and $messages->count() > 0) {{-- body of the chat --}}
{{--

Yesterday
--}} {{-- incoming message not sent by auth()->user() --}}
@foreach ($messages as $myChat) @if ($myChat->sender !== auth()->id())
avatar
@if ($myChat->msg_type == 'text')

{{ $myChat->msg }}

@elseif($myChat->msg_type == 'file')
@endif
09:46 AM{{-- time msg was sent --}}
@else {{-- message sent by auth()->user() --}}
@if ($myChat->msg_type == 'text')

{{ $myChat->msg }}

@elseif($myChat->msg_type == 'file')
@endif
11:32 AM
{{-- only display if it's the last message sent by user in the conversation --}} avatar {{-- @include('partials.main-chart-box.file_msg') --}}
{{--

This is the main image for your product category

--}}
@endif @endforeach
{{-- dummy chats --}} {{-- @include('partials.main-chart-box.dummy_chat') --}} {{-- future :using dates to navigate in the chat UI --}}

{{-- Today --}}
{{-- message type file --}} {{-- @include('partials.main-chart-box.file_msg') --}} {{-- @include('partials.main-chart-box.msg_typing') --}}
@elseif ($selectedUser and $messages->count() == 0)
forum

Seems people are shy to start the chat. Break the ice send the first message.

@endif {{-- chat footer, where we write messages --}} @include('partials.main-chart-box.chart-box-footer-section')
@include('partials.main-chart-box.chart-box-call-ui')