@foreach ($chats as $chat) @if ($chat->message != null)
@if ($chat->sender->photo != null) @else @endif
{{ $chat->message }}
{{ Carbon\Carbon::parse($chat->created_at)->diffForHumans() }}
@endif @if ($chat->attachment != null)
sender->photo != null) src="{{ uploaded_asset(($chat->sender->photo))}}" @endif>
@foreach (json_decode($chat->attachment) as $key => $attachment_id) @php $attachment = \App\Models\Upload::find($attachment_id); @endphp @if ($attachment != null) @if ($attachment->type == 'image') @else @endif @else @endif @endforeach
{{ Carbon\Carbon::parse($chat->created_at)->diffForHumans() }}
@endif @endforeach