/** * Autocomplete for student textbox in parent registration. * * @param array $data * @return User */ protected function studentAutocomplete() { $term = trim(Input::get('term')); //get Input value $result = ""; //if (is_null($term) or $term =="") return; $ut = UserType::where('name', 'student')->first(['id']); $user = User::where('user_type_id', $ut->id)->orderBy('name')->get(['id', 'name']); foreach ($user as $student) { if (strpos(strtolower($student['name']), $term) !== false) { $result[] = ['value' => $student['name'], 'id' => $student['id']]; } } return Response::json($result); }
/** * Show usertypes * * @return Response */ public function index() { $ut = UserType::where('name', '!=', 'SuperAdmin')->get(); return view('userTypes/userTypes', ['UserType' => $ut]); }