コード例 #1
0
ファイル: UserController.php プロジェクト: AxelFaulken/ODRMS
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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');
 }