id; $data['notes'] = Note::where('user_id',$user_id)->orderBy('time')->get(); $chk = AssignProject::where('user_id',$user_id)->distinct('proj_id')->get(); $proj_id_ary = array(); if(count($chk) > 0) { foreach($chk as $info) { array_push($proj_id_ary, $info->proj_id); } $data['created_task'] = Task::whereIn('proj_id',$proj_id_ary)->where('status',1)->get(); $data['inprocess_task'] = Task::whereIn('proj_id',$proj_id_ary)->where('status',2)->get(); } $client_id=\Auth::user()->id; if(\Auth::user()->utype==3) { $data['tickets']=Ticket::with(['user','created_user'])->where('client_id',$client_id)->orderBy('id','desc')->get(); } else { $data['tickets']=Ticket::with(['user','created_user'])->orderBy('id','desc')->get(); } return view('client.client_dashboard',$data); } }