public function edit($id) { $current_office_id = Auth::user()->office_id; $current_division_id = Auth::user()->division; $valid_office = Office::where('id', $current_office_id)->first()->name; $valid_division = OfficeDivision::where('id', $current_division_id)->first()->name; $placing = Placing::find($id); return view('placings.edit', compact('placing', 'valid_office', 'valid_division')); }
public function edit_depart($id, $id_depart) { $division = OfficeDivision::where('office_divisions.id', $id)->first(); $depart = OfficeDepart::find($id_depart); return view('offices.edit_depart', compact('depart', 'division')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $user = User::find($id); $roles = Role::lists('name', 'id'); $office_region = Office::select(\DB::raw("CONCAT(offices.code,'-',offices.name) AS full_name, id"))->lists('full_name', 'id'); $division_kprk = OfficeDivision::select(\DB::raw("CONCAT(code,'-',name) AS full_name, id"))->lists('full_name', 'id'); return view('users.edit', compact('user', 'roles', 'office_region', 'division_kprk')); }