@extends('layouts.app') @push('styles') @endpush @push('scripts') @endpush @section('content')
@if(isset($otherUser)) @php $photoUrl = $otherUser->profile_photo_url; @endphp @if($photoUrl) {{ $otherUser->name }} @else
{{ strtoupper(substr($otherUser->name, 0, 1)) }}
@endif
@else
?
@endif

{{ $otherUser->name ?? 'User' }}

@if(isset($otherUser) && $otherUser->role === 'prestataire') Prestataire @elseif(isset($otherUser)) Client @endif @if(isset($otherUser) && ($otherUser->is_online ?? false)) En ligne @else {{ isset($otherUser) ? ($otherUser->online_status ?? 'Hors ligne') : 'Hors ligne' }} @endif
@forelse($messages as $message)
{{ $message->content }}
@if($message->attachments && count($message->attachments) > 0)
@foreach($message->attachments as $attachment) @endforeach
@endif
{{ $message->created_at->format('H:i') }} @if($message->sender_id === Auth::id()) @if($message->read_at) @else @endif @endif
@empty

Commencez la conversation

Envoyez votre premier message à {{ isset($otherUser) ? $otherUser->name : 'ce contact' }} pour démarrer la discussion.

@endforelse
@csrf
0/1000
@endsection