@if($rooms) @foreach($rooms as $room) @php( $user_id = Auth::user()->id)
  • {{-- {{asset('images/users/'. $room->sender->image)}}--}} avatar
    {{$room->sender_id != $user_id ? $room->sender->name : $room->receiver->name}}
    {{$room->messages()->latest()->value('created_at') ? \Carbon\Carbon::parse($room->messages()->latest()->value('created_at'))->diffForHumans() : \Carbon\Carbon::parse($room->created_at)->diffForHumans() }}

    {{$room->messages()->latest()->value('body') ? $room->messages()->latest()->value('body') : ''}}

  • @endforeach @else

    لا يوجد مستخدم بهذا الاسم

    @endif