@foreach($messages as $message)
<!-- Recepient Message -->
@if($message->user_id == 0)
<div class="chat-message chat-recepient d-flex">
<div class="chat-user-img-box align-self-end">
  <img src="{{ asset('images/Avatar.png') }}" alt="User">
</div>
<div class="single-message-chat">
  <p class="user-message">{!!$message->message!!}</p>
  <p class="message-time">{{ \Carbon\Carbon::parse($message->created_at)->format('h:i A') }}</p>
</div>
</div>
<!-- Sender Message -->
@elseif($message->user_id == 1)
<div class="chat-message chat-sender d-flex justify-content-end">
<div class="single-message-chat">
  @if(!containsHtml($message->message))
  <p class="user-message bg-light-green-color color-light">{!!$message->message!!}</p>
  @else
  {!! $message->message !!}
  @endif
  <p class="message-time">{{ \Carbon\Carbon::parse($message->created_at)->format('h:i A') }}</p>
</div>
<div class="chat-user-img-box align-self-end">
  <img src="{{ asset('images/Avatar.png') }}" alt="User">
</div>
</div>
@endif
@endforeach