@extends('user.layouts.header') @section('styles') @endsection @section('content') @if(count($chatroomdetails) > 0)

Chats

@foreach($chatroomdetails as $chatroomdetail) @php $investor_id = $chatroomdetail->investor_id; $inventor_id = $chatroomdetail->inventor_id; if($investor_id == Auth::user()->id){ $sen_id = $inventor_id; }else{ $sen_id = $investor_id; } @endphp @php $ch = DB::table('chat')->where('chat_id', $chatroomdetail->chat_id )->orderBy('id','DESC')->limit('1')->get(); @endphp @endforeach
Name Date Last Message Chat
@foreach($users as $user) @if($user->id == $sen_id) @php $idu = Crypt::encrypt($user->id); @endphp @if(!empty($user->profile_image)) @else @endif @if(!empty($user->name)){{ $user->name}}@else {{ $user->email}} @endif @if(!empty($user->last_name)){{ $user->last_name}}@endif @else @endif @endforeach @php if(count($ch)>0){ foreach($ch as $c){ echo $c->created_at; } }else{ echo "-"; } @endphp @php if(count($ch)>0){ foreach($ch as $c){ echo $c->msg; } }else{ echo "No Message"; } @endphp @php $not = DB::table('chat_notification')->where('user_id', Auth::user()->id )->where('chat_id', $chatroomdetail->chat_id )->where('status', '0' )->orderBy('id','DESC')->get(); @endphp @php $ide = Crypt::encrypt($chatroomdetail->id); @endphp Chat @if(count($not)>0)@php echo count($not); @endphp@endif
@else

Oops!

You haven't started chat with anyone yet!

@endif @endsection @section('scripts') @endsection