@extends('layouts.admin') @section('content')
@include('include.flash-message')
@csrf
@if (count($chat) > 0) @foreach ($chat as $item) @if ($myId == $item->userId)
You
{{ \Carbon\Carbon::parse($item->created_at)->diffForHumans() }}
{{ $item->message }}
@else
@isset($item->sender) {{ $item->sender->firstName . ' ' . $item->sender->lastName }} @endisset
{{ \Carbon\Carbon::parse($item->created_at)->diffForHumans() }}
{{ $item->message }}
@endif @endforeach @endif
@endsection