public function viewCandidateProfile($candidate_id)
 {
     //Hashids::getDefaultConnection();
     $decoded = Hashids::decode($candidate_id);
     //return count($decoded);
     //code for displaying full profle with bio, educations detals, experience details and so
     $candidate = Candidate::find($decoded)->first();
     //return $candidate;
     $info = CandidateInfo::where('candidate_id', $decoded)->first();
     //$edu = CandidateEduDetails::where('candidate_id', $decoded)->get();
     $edu = CandidateEduDetails::where('candidate_id', $decoded)->join('master_exams', 'candidate_edu_details.exam_id', '=', 'master_exams.id')->join('master_boards', 'candidate_edu_details.board_id', '=', 'master_boards.id')->join('master_subjects', 'candidate_edu_details.subject_id', '=', 'master_subjects.id')->select('master_exams.name as exam_name', 'master_exams.exam_category', 'candidate_edu_details.specialization', 'candidate_edu_details.pass_year', 'candidate_edu_details.percentage', 'master_boards.name as board_name', 'master_subjects.name as subject_name')->get();
     //::join('candidates', 'candidate_infos.candidate_id', '=', 'candidates.id')
     $lang = CandidateLanguageInfo::where('candidate_id', $decoded)->get();
     $exp = CandidateExpDetails::where('candidate_id', $decoded)->join('master_industry_types', 'candidate_experience_details.industry_id', '=', 'master_industry_types.id')->join('master_subjects', 'candidate_experience_details.experience_id', '=', 'master_subjects.id')->select('master_subjects.name as exp_type', 'master_industry_types.name as sector', 'candidate_experience_details.post_held', 'candidate_experience_details.year_experience', 'candidate_experience_details.salary', 'candidate_experience_details.employers_name')->orderBy('candidate_experience_details.id', 'DESC')->get();
     return view('admin.applications.profile', compact('candidate', 'info', 'edu', 'lang', 'exp'));
 }
 public static function check_candidate($id)
 {
     $candidate = Candidate::find($id);
     $info = CandidateInfo::where('candidate_id', $id)->count();
     $edu = CandidateEduDetails::where('candidate_id', $id)->count();
     $lang = CandidateLanguageInfo::where('candidate_id', $id)->count();
     if ($info == 0 || $edu == 0 || $lang == 0) {
         return false;
     } else {
         return true;
     }
 }