@extends('communication.chat.index') @section('chat_content')
@php $otherUser = $conversation->user_one_id === Auth::id() ? $conversation->userTwo : $conversation->userOne; @endphp @if($otherUser)
{{ substr($otherUser->name, 0, 1) }}

{{ $otherUser->name }}

En ligne
@else
?

Utilisateur inconnu

@endif
@if(session('error'))
{{ session('error') }}
@endif @foreach($messages as $msg)

{{ $msg->content }}

{{ $msg->created_at->format('H:i') }} @if($msg->sender_id === Auth::id()) @endif
@endforeach
@csrf
@endsection