/** * Display a listing of the resource. * * @return Response */ public function index() { try { $statusCode = 200; // $response = [ // 'Education List' => [] // ]; $educations = Education::all(); foreach ($educations as $education) { // $response['Education List'][] = ['id' => $education->id, 'Education' => $education->education]; } // $response=$gender; } catch (Exception $e) { $statusCode = 400; } finally { return Response::json($response, $statusCode); } }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $title = 'job'; $skills = Skills::lists('name', 'name'); if (Auth::user()->identifier == 1) { $postjob = Postjob::where('unique_id', '=', $id)->where('individual_id', '=', Auth::user()->induser_id)->first(); $connections = Induser::whereRaw('indusers.id in ( select connections.user_id as id from connections where connections.connection_user_id=? and connections.status=1 union select connections.connection_user_id as id from connections where connections.user_id=? and connections.status=1 )', [Auth::user()->induser_id, Auth::user()->induser_id])->get(['id', 'fname'])->lists('fname', 'id'); $groups = Group::leftjoin('groups_users', 'groups_users.group_id', '=', 'groups.id')->where('groups.admin_id', '=', Auth::user()->induser_id)->orWhere('groups_users.user_id', '=', Auth::user()->induser_id)->groupBy('groups.id')->get(['groups.id as id', 'groups.group_name as name'])->lists('name', 'id'); $education = Education::orderBy('level')->orderBy('name')->get(); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); return view('pages.postjob_edit', compact('title', 'skills', 'connections', 'groups', 'education', 'farearoleList', 'postjob')); } else { $postjob = Postjob::where('unique_id', '=', $id)->where('corporate_id', '=', Auth::user()->corpuser_id)->first(); $education = Education::all(); $farearoleList = Functional_area_role_mapping::orderBy('id')->get(); return view('pages.postjob_edit', compact('title', 'skills', 'education', 'farearoleList', 'postjob')); } }