/** * 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.'); }
/** * 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.']); }