/** * Lists the jobposts of an industry . * * @param int $id profile id * @return Response */ public function forindustry($id) { //dd($id); $profile = Profile::findOrFail($id); $iid = $profile->industry_id; /* $jobposts = DB::table('jobposts') ->join('employers', 'jobposts.employer_id', '=', 'employers.id') ->join('jobtypes', 'jobposts.jobtype_id', '=', 'jobtypes.id') ->select('jobposts.id', 'jobposts.jobtitle', 'jobposts.request_date', 'employers.company_name') ->where('jobtypes.industry_id', '=', $iid) ->get(); */ $jobposts = Jobpost::byindustry($iid)->get(); //return response()->json(compact('jobposts')); return view('candidate_jobposts.forindustry', compact('profile', 'jobposts')); }
/** * Returns a json list of jobposts of an industry . * * @param int $id industry_id * @return Response */ public function forindustry($id) { $jobposts = Jobpost::byindustry($id)->get(); return response()->json(compact('jobposts')); }