@extends('admin.layout') @push('css') @endpush @section('content') @php // Determine the correct recipient name based on the logged-in user $recipient = ($chat->user_id === auth()->id()) ? $chat->recipient : $chat->user; @endphp

Chat con {{ $recipient->name }}

@foreach($messages as $message)

{{ $message->user->name }}: {{ $message->body }}
{{ $message->created_at->format('d M Y, H:i') }}

@endforeach
@csrf
@endsection @section('js') @endsection