/**
  * Display the specified resource.
  *
  * @param  int $pid 	profile id
  * @param  int  $id		post id
  * @return \Illuminate\Http\Response
  */
 public function show($pid, $id)
 {
     //dd($id);
     $profile = Profile::findOrFail($pid);
     $jobpost = Jobpost::findOrFail($id);
     return view('candidate_jobposts.show', compact('profile', 'jobpost'));
 }
Exemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $eid 	employer_id
  * @param  int  $id		jobpost_id
  * @return Response
  */
 public function destroy($eid, $id)
 {
     $employer = Employer::findOrFail($eid);
     $jobpost = Jobpost::findOrFail($id);
     $jobpost->delete();
     return view('jobposts.index', compact('employer'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $iid	jobpost id
  * @param  int  $id		jobtag id
  * @return Response
  */
 public function destroy($iid, $id)
 {
     $jobpost = Jobpost::findOrFail($iid);
     $jobtag = $jobpost->jobtags()->where('id', $id)->first();
     $jobpost->jobtags()->detach($jobtag);
     return view('jobpost_jobtags.index', compact('jobpost'));
 }
Exemplo n.º 4
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id jobpost id
  * @return Response
  */
 public function show($id)
 {
     $jobpost = Jobpost::findOrFail($id);
     $coordinates = [$jobpost->location->latitude, $jobpost->location->longitude];
     $tags = collect();
     foreach ($jobpost->jobtags as $jobtag) {
         $tags->push($jobtag->name);
     }
     $jobpost = Jobpost::byjobpostid($id)->first();
     //dd($jobpost->locat);
     return response()->json(compact('jobpost', 'coordinates', 'tags'));
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $eid 	employer_id
  * @param  int  $id		jobpost_id
  * @param Request $request
  * @return Response
  */
 public function update($id, Request $request)
 {
     $jobpost = Jobpost::findOrFail($id);
     //$location = Location::findOrFail($jobpost->location_id);
     $location = $jobpost->location;
     $location->address = $request->input('address');
     $location->postal_code = $request->input('postal_code');
     $location->city = $request->input('city');
     $location->province = $request->input('province');
     $location->country_code = $request->input('country_code');
     $location->latitude = $request->input('latitude');
     $location->longitude = $request->input('longitude');
     $location->save();
     //$jobpost->location_id = $location->id;
     //$jobpost->save();
     return view('jobposts.index', compact('employer'));
 }