- return view('users.account.index', [
- 'mfaMethods' => $mfaMethods,
+ /**
+ * Show the profile form interface.
+ */
+ public function showProfile()
+ {
+ $this->setPageTitle(trans('preferences.profile'));
+
+ return view('users.account.profile', [
+ 'model' => user(),
+ 'category' => 'profile',
+ ]);
+ }
+
+ /**
+ * Handle the submission of the user profile form.
+ */
+ public function updateProfile(Request $request, ImageRepo $imageRepo)
+ {
+ $this->preventAccessInDemoMode();
+
+ $user = user();
+ $validated = $this->validate($request, [
+ 'name' => ['min:2', 'max:100'],
+ 'email' => ['min:2', 'email', 'unique:users,email,' . $user->id],
+ 'language' => ['string', 'max:15', 'alpha_dash'],
+ 'profile_image' => array_merge(['nullable'], $this->getImageValidationRules()),