middleware('admin'); } public function dashboard() { $admin = Auth::guard('admin')->user(); $register_active_teachers_list =User::where( 'apply_status',1 )->where( 'sign_up',1 )->where( 'user_type',2 )->orderBy( 'id','DESC' )->get(); $register_student_list =User::where( 'user_type',1 )->where( 'sign_up',1 )->orderBy( 'id','DESC' )->get(); $invited_registered_list =User::where( 'user_type',2 )->whereNotNull( 'admin_invite_id' )->where( 'register_type',1 //1=teacher invitation )->orderBy( 'id','DESC' )->get(); $landing_wishlist =User::where( 'user_type',2 )->where( 'register_type',2 // 2=teacher landing )->orderBy( 'id','DESC' )->get(); $market_countries = MarketCountry::where( 'status', 1 )->select( 'market_countries.*', \DB::raw('(SELECT name FROM countries WHERE market_countries.country_id = countries.id ) as sort') )->orderBy('sort')->get(); $student_refer_friend_list =User::where( 'register_type',6 // 6 = student refer a friend for a proposal )->where( 'user_type',1 )->orderBy('id','DESC')->get(); $application = StudentProposal::orderBy('id','DESC')->get(); $data =[ 'register_active_teachers_list'=>$register_active_teachers_list, 'register_student_list'=>$register_student_list , 'market_countries'=>$market_countries, 'refer_users'=>$student_refer_friend_list, 'invited_registered_list'=>$invited_registered_list, 'application'=>$application, 'landing_wishlist'=>$landing_wishlist ]; return view('admin.admin_profile',$data); } public function load_country_list($text){ $selected = MarketCountry::pluck('country_id')->toArray(); if($text == '0'){ $countries = Country::where('status', 1)->paginate(10); }else{ $countries = Country::where('status', 1)->where('name','like', '%'.$text.'%')->paginate(10); } return view('admin.loadCountry', compact('countries','selected')); } }