@foreach ($participants as $participant)
@if($participant->photo_path)
photo_path)}}">
@else
@endif
@if ($users_present && array_search($participant->id, $users_present) !== false)
@else
@endif
{{$participant->first_name}} {{$participant->last_name}}
@if ($users_present && array_search($participant->id, $users_present) !== false)
Online
@else
Offline
@endif
@endforeach
@foreach ($participants as $participant)
@if($participant->photo_path)
photo_path)}}">
@else
@endif
@if ($users_present && array_search($participant->id, $users_present) !== false)
@else
@endif
{{$participant->first_name}} {{$participant->last_name}}
@if ($users_present && array_search($participant->id, $users_present) !== false)
Online
@else
Offline
@endif
@endforeach
-
-
-
@if(!$chat_muted)
@else
@endif
-
-
{{--
--}}
@if($files_uploaded && count($files_uploaded) > 0)
@foreach ($files_uploaded as $index => $new_file)
@if($new_file->getClientOriginalExtension() == "png" || $new_file->getClientOriginalExtension() == "jpg" || $new_file->getClientOriginalExtension() == "jpeg")
{{--
--}}
{{$new_file->getClientOriginalName()}}
@else
{{$new_file->getClientOriginalName()}}
{{--
{{$new_file->getClientOriginalName()}}"
--}}
@endif
@endforeach
@endif
@if( $messages && count($messages) > 0)
@foreach ($messages as $message)
@php
$next = null;
$prev = null;
$iter_temp = $loop->iteration;
$iter = $iter_temp-1;
$iter_prev = $iter_temp-1;
$prev_message;
if($loop->iteration != count($messages)){
$next = $messages->get(++$iter ) ;
}
if($loop->iteration != 1){
$prev = $messages->get(--$iter_prev) ;
}
@endphp
@if($message->message_from == Auth::user()->id)
@if(!$prev || $prev->message_from != $message->message_from)
@php $prev_message = $message; @endphp
{!!$message->message_body!!}
@if($message->files)
@foreach ($message->files as $file)
@if($file->type == 'media')
file_path)}}">
@elseif($file->type == 'file')
@endif
@endforeach
@endif
@else
{!!$message->message_body!!}
@if($message->files)
@foreach ($message->files as $file)
@if($file->type == 'media')
file_path)}}">
@elseif($file->type == 'file')
@endif
@endforeach
@endif
@endif
@if($next)
@if($next->message_from != $message->message_from)
{{-- @livewire('conversation.partials.get-time',['time' => $prev_message->created_at], key(rand())) --}}
@else
@if($next && $next->message_from == $message->message_from && (\Carbon\Carbon::parse($message->created_at)->diffForHumans() != \Carbon\Carbon::parse($next->created_at)->diffForHumans()))
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@elseif(!$prev && !$next)
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@elseif(!$next)
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@endif
@endif
@else
{{-- @livewire('conversation.partials.get-time',['time' => $prev_message->created_at], key(rand())) --}}
@endif
@else
@if($scroll_to_unread && $scroll_to_unread->id === $message->id)
@endif
@if(!$prev || $prev->message_from != $message->message_from)
@php $prev_message = $message; @endphp
@if($message->user->photo_path)
user->photo_path)}}">
@else
@endif
{!!$message->message_body!!}
@if($message->files)
@foreach ($message->files as $file)
@if($file->type == 'media')
file_path)}}">
@elseif($file->type == 'file')
@endif
@endforeach
@endif
@else
{!!$message->message_body!!}
@if($message->files)
@foreach ($message->files as $file)
@if($file->type == 'media')
file_path)}}">
@elseif($file->type == 'file')
@endif
@endforeach
@endif
@endif
@if($next)
@if($next->message_from != $message->message_from)
{{-- @livewire('conversation.partials.get-time',['time' => $prev_message->created_at], key(rand())) --}}
@else
@if($next && $next->message_from == $message->message_from && (\Carbon\Carbon::parse($message->created_at)->diffForHumans() != \Carbon\Carbon::parse($next->created_at)->diffForHumans()))
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@elseif($next && $next->message_from != $message->message_from)
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@elseif(!$prev && !$next)
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@elseif(!$next)
{{-- @livewire('conversation.partials.get-time',['time' => $message->created_at], key(rand())) --}}
@endif
@endif
@else
{{-- @livewire('conversation.partials.get-time',['time' => $prev_message->created_at], key(rand())) --}}
{{--
@livewire('conversation.partials.get-time',['time' => $message->created_at, 'next' => $next, 'prev' => $prev], key(rand()))
--}}
@endif
@endif
@if($loop->iteration == (count($messages) - 1) && $hasMorePages)
This chat has been blocked, you will not recevied new messages.
@endif
{{-- @push('scripts')
@endpush --}}