/** * Update the user's profile information. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function updateUserProfile(Request $request) { $this->validateUserProfile($request); if (kAuth::$updateProfilesWith) { $this->callCustomUpdater(kAuth::$updateProfilesWith, $request); } else { Auth::user()->fill($request->all())->save(); } event(new ProfileUpdated(Auth::user())); return $this->users->getCurrentUser(); }
/** * Handle a registration request for the application. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ protected function register(Request $request) { $this->validateRegistration($request); $user = $this->users->createUserFromRegistrationRequest($request); if ($request->team_name) { $team = $this->teams->create($user, ['name' => $request->team_name]); event(new TeamCreated($team)); } if ($request->invitation) { $this->teams->attachUserToTeamByInvitation($request->invitation, $user); } event(new Registered($user)); Auth::login($user); return redirect()->intended($this->redirectPath()); }
/** * Get the current user of the application. * * @return \Illuminate\Http\Response */ public function getCurrentUser() { return $this->users->getCurrentUser(); }