@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)
@elseif($chat->sender_id != Auth::user()->id && $chat->sender_id != $investor_id && $chat->sender_id != $inventor_id) @else @endif @endforeach @endif @elseWe Initiate the three-way chat, start chat with Invention Funder