@forelse($threads as $thread) @if(!is_null($thread->thread))
  • avatar
    {{ $thread->withUser->prenom.' '.$thread->withUser->nom }}

    {{substr($thread->thread->message, 0, 25).' ...'}} @if(auth()->user()->id == $thread->thread->sender->id) @endif

    {{ \Carbon\Carbon::createFromTimeStamp(strtotime($thread->thread->created_at))->diffForHumans() }}

    @php $count_unread = 0; $convers = Talk::getMessagesByUserId($thread->withUser->id); if ($convers) { $messagesConv = $convers->messages; foreach($messagesConv as $messageConv){ if(!$messageConv->is_seen && $messageConv->user_id != auth()->user()->id){ $count_unread ++; } } } @endphp @if($count_unread) {{ $count_unread }} @endif
  • @endif @empty
  • Pas encore de message !
  • @endforelse