예제 #1
0
 /**
  * Update the specified resource in storage.
  * PUT /user/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $user = $this->userRepository->findById($id);
     $manager = new UserManager($user, Input::all(), 'edit');
     $manager->save();
     return Redirect::route('user')->with('successMessage', 'El usuario se ha editado con éxito.');
 }
예제 #2
0
 /**
  * Store a new User created resource in storage.
  * POST /register
  *
  * @return Response
  */
 public function register()
 {
     $user = $this->userRepository->newuser();
     $manager = new UserManager($user, Input::all(), 'register');
     $manager->save();
     if (Auth::attempt(Input::only('email', 'password'))) {
         return Redirect::route('app.index')->with(['successMessage' => 'Se ha registrado con éxito.', 'showSideBar' => true, 'showProfile' => true]);
     }
     return Redirect::route('app.index')->with(['successMessage' => 'Se ha registrado con éxito.']);
 }