/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $groups = ['0' => 'Select User Group'] + UserGroup::select('id', 'group_name')->orderBy('group_name')->lists('group_name', 'id')->toArray(); $user = User::with('group')->findOrFail($id); $agencies = Agency::orderBy('name')->lists('name', 'id'); $dentists = Dentist::orderBy('name')->lists('name', 'id'); $data = array('user' => $user, 'groups' => $groups, 'agencies' => $agencies, 'dentists' => $dentists, 'pageTitle' => 'ODRMS - User Management - Edit: ' . $user->name); return view('libraries.users.edit', $data); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $dent = Dentist::findOrFail($id); $dent->delete(); flash()->success('Record deleted.'); return redirect('admin/dentists'); }