middleware('admin'); $this->api_base_url = apiUrl(); } public function ajaxGET(Request $request, $name){ $loggedin = Auth::guard('admin')->user(); if($name == 'sams_institutes'){ $destination = $request->destination; $type = $request->type; $data = getApiRequest($this->api_base_url.'api/sams-institutes/v1/get-institutes?destination='.$destination.'&type='.$type); return $data; }elseif($name == 'sams_levels'){ $institute = $request->institute; $group = $request->group; $data = getApiRequest($this->api_base_url.'api/sams-institutes/v1/get-levels?institute='.$institute.'&group='.$group); return $data; }elseif($name == 'sams_campuses'){ $institute = $request->institute; $data = getApiRequest($this->api_base_url.'api/sams-institutes/v1/get-campuses?institute='.$institute); return $data; }elseif($name == 'sams_intakes'){ $institute = $request->institute; $level = $request->level; $data = getApiRequest($this->api_base_url.'api/sams-institutes/v1/get-intakes?institute='.$institute.'&level='.$level); return $data; }else{ return response([ 'msg'=>'Wrong Request! nothing to load.' ], 403); } return view('admin.admins.list',compact('admins')); } }