-
@foreach ($messages as $msg)
@php
$type='receiver';
$sender_type=$msg->getSender->name;
if ($msg->sender_type==0) {
$type='sender';
$sender_type=$user->name;
}
@endphp
- {{$sender_type}}: {{$msg->message}}{{date('Y/m/d H:i',strtotime($msg->updated_at))}}
@endforeach