/**
  * Returns a json list of jobposts of jobtype.
  *
  * @param  int $id 	jobtype_id
  * @return Response
  */
 public function forjobtype($id)
 {
     /*
     $jobposts = Jobpost::join('employers', 'jobposts.employer_id', '=', 'employers.id')
     			->where('jobtype_id', '=', $id)
     			->select('jobposts.request_date', 'employers.company_name')
     			->get();
     */
     $jobposts = Jobpost::byjobtype($id)->get();
     return response()->json(compact('jobposts'));
 }
 /**
  * Lists the job posts of a job type .
  *
  * @param  int $id 	profile id
  * @param  int $tid 	job type id
  * @return Response
  */
 public function forjobtype($id, $tid)
 {
     //dd($id);
     $profile = Profile::findOrFail($id);
     $jobposts = Jobpost::byjobtype($tid)->get();
     $jobtype = Jobtype::findOrFail($tid);
     //return response()->json(compact('jobposts'));
     return view('candidate_jobposts.forjobtype', compact('profile', 'jobposts', 'jobtype'));
 }