Esempio n. 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $user = User::findOrFail($id);
     $roles = Role::get();
     $areas = Area::get();
     return view('admin.users.edit', compact('user', 'roles', 'areas'));
 }
Esempio n. 2
0
 public function area()
 {
     return $this->belongsTo(Area::getClass());
 }
Esempio n. 3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy($id, Request $request)
 {
     $area = Area::findOrFail($id);
     $success = $area->delete();
     if ($request->ajax()) {
         return response()->json(compact('success'));
     }
     Session::flash('danger', 'Se eliminó correctamente');
     return redirect()->route('admin.areas.index');
 }