@php $admin_id = DB::table('users')->where('role', 'admin')->pluck('id')->first(); $sender_id = Auth::user()->id; if($sender_id == $admin_id){ $receiver_id = $inventor_id; $receiver_id2 = $investor_id; }else if($sender_id == $investor_id){ $receiver_id = $inventor_id; $receiver_id2 = $admin_id; }else{ $receiver_id = $investor_id; $receiver_id2 = $admin_id; } @endphp @if(count($chats) > 0) @if(!empty($chats)) @php $a = array(); @endphp @foreach($chats as $chat) @php date_default_timezone_set("Asia/Kolkata"); $currnt_time = date("Y-m-d H:i:s"); // time function $t_time = strtotime($chat->created_at); $datenew=date_create("$chat->created_at"); $fordate = date_format($datenew,"d/m/Y"); $today = date("d/m/Y"); $yes = date('d/m/Y',strtotime("-1 days")); if(in_array($fordate, $a)){ }else{ array_push($a, $fordate); @endphp @php if($today == $fordate){ @endphp Today @php }else if($yes == $fordate){ @endphp Yesterday @php } else{ @endphp @php echo $fordate; @endphp @php } } @endphp @if($chat->sender_id == Auth::user()->id)
@php if(!empty($chat->files)){ $file = new SplFileInfo($chat->files); $ex = $file->getExtension(); @endphp @php if($ex == 'jpg' || $ex == 'jpeg' || $ex == 'png' || $ex == 'gif' || $ex == 'webp' ){ @endphp

Astemotori

@php }else{ @endphp Document @php } @endphp @php } @endphp @php echo substr($chat->msg, 0, 500); @endphp @php $maxcount = strlen($chat->msg); @endphp @php if($maxcount > 500){ @endphp @php echo substr($chat->msg, 500, $maxcount); @endphp @php } @endphp @if($maxcount > 500) @endif
@php echo date('h:i A', strtotime($chat->created_at)); @endphp
@foreach($allusers as $alluser) @if($sender_id == $alluser->id) @if(!empty($alluser->profile_image)) @else @endif @else @endif @endforeach
@elseif($chat->sender_id != Auth::user()->id && $chat->sender_id != $investor_id && $chat->sender_id != $inventor_id)
@php if(!empty($chat->files)){ $file = new SplFileInfo($chat->files); $ex = $file->getExtension(); @endphp @php if($ex == 'jpg' || $ex == 'jpeg' || $ex == 'png' || $ex == 'gif' || $ex == 'webp' ){ @endphp

Astemotori

@php }else{ @endphp Document @php } @endphp @php } @endphp @php echo substr($chat->msg, 0, 500); @endphp @php $maxcount = strlen($chat->msg); @endphp @php if($maxcount > 500){ @endphp @php echo substr($chat->msg, 500, $maxcount); @endphp @php } @endphp @if($maxcount > 500) @endif
@foreach($admins as $admin) @if($receiver_id2 == $admin->id) @if(!empty($admin->profile_image)) @else @endif @else @endif @endforeach
@php echo date('h:i A', strtotime($chat->created_at)); @endphp
@else
@php if(!empty($chat->files)){ $file = new SplFileInfo($chat->files); $ex = $file->getExtension(); @endphp @php if($ex == 'jpg' || $ex == 'jpeg' || $ex == 'png' || $ex == 'gif' || $ex == 'webp' ){ @endphp

Astemotori

@php }else{ @endphp Document @php } @endphp @php } @endphp @php echo substr($chat->msg, 0, 500); @endphp @php $maxcount = strlen($chat->msg); @endphp @php if($maxcount > 500){ @endphp @php echo substr($chat->msg, 500, $maxcount); @endphp @php } @endphp @if($maxcount > 500) @endif
@foreach($allusers as $alluser) @if($receiver_id == $alluser->id) @if(!empty($alluser->profile_image)) @else @endif @else @endif @endforeach
@php echo date('h:i A', strtotime($chat->created_at)); @endphp
@endif @endforeach @endif @else
Start chat

We Initiate the three-way chat, start chat with Invention Funder

@endif