Ejemplo n.º 1
0
 /**
  * Show the user profile.
  *
  * @return Response
  */
 public function profile()
 {
     try {
         $user = User::with('groups')->findOrFail(Auth::user()->id);
         Debugbar::info($user->toArray());
         $user_form = \FormBuilder::create('Isabry\\Gatekeeper\\Forms\\UserForm', ['model' => $user])->remove('password')->remove('password_confirmation');
         return view('gatekeeper::home.profile')->with(compact('user_form'))->with('user', $user);
     } catch (ModelNotFoundException $e) {
         Session::flash('error', 'User not found (id: ' . $id . ')');
         return Redirect::intended('/');
     }
 }
Ejemplo n.º 2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     try {
         $user = User::with('groups')->findOrFail($id);
         Debugbar::info($user->toArray());
         $user_form = \FormBuilder::create('Isabry\\Gatekeeper\\Forms\\UserForm', ['model' => $user])->remove('password')->remove('password_confirmation');
         $url = '<a role="button" href="' . route('users.index') . '" class="btn btn-primary">' . '  <i class="fa fa-mail-reply"></i> Back to Users List' . '</a>';
         return view('gatekeeper::users.view')->with('title', 'User (' . $user->name . ')')->with(compact('user_form'))->with('url', $url);
     } catch (ModelNotFoundException $e) {
         Session::flash('error', 'User not found (id: ' . $id . ')');
         return Redirect::intended('users');
     }
 }