diff --git a/app/Actions/User/UpdateUserProfileInformation.php b/app/Actions/User/UpdateUserProfileInformation.php index 6efa12c1..422f97ef 100755 --- a/app/Actions/User/UpdateUserProfileInformation.php +++ b/app/Actions/User/UpdateUserProfileInformation.php @@ -19,6 +19,10 @@ public function update(User $user, array $input): void Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)], + 'timezone' => [ + 'required', + Rule::in(timezone_identifiers_list()), + ], ])->validateWithBag('updateProfileInformation'); if ($input['email'] !== $user->email) { @@ -27,6 +31,7 @@ public function update(User $user, array $input): void $user->forceFill([ 'name' => $input['name'], 'email' => $input['email'], + 'timezone' => $input['timezone'], ])->save(); } } @@ -39,6 +44,7 @@ protected function updateVerifiedUser(User $user, array $input): void $user->forceFill([ 'name' => $input['name'], 'email' => $input['email'], + 'timezone' => $input['timezone'], ])->save(); } } diff --git a/app/Http/Livewire/Profile/UpdateProfileInformation.php b/app/Http/Livewire/Profile/UpdateProfileInformation.php index 95802864..6d87f1c9 100644 --- a/app/Http/Livewire/Profile/UpdateProfileInformation.php +++ b/app/Http/Livewire/Profile/UpdateProfileInformation.php @@ -15,10 +15,13 @@ class UpdateProfileInformation extends Component public string $email; + public string $timezone; + public function mount(): void { $this->name = auth()->user()->name; $this->email = auth()->user()->email; + $this->timezone = auth()->user()->timezone; } /** diff --git a/resources/views/livewire/profile/update-profile-information.blade.php b/resources/views/livewire/profile/update-profile-information.blade.php index fd2e4f2b..fcbf0bad 100644 --- a/resources/views/livewire/profile/update-profile-information.blade.php +++ b/resources/views/livewire/profile/update-profile-information.blade.php @@ -45,6 +45,18 @@ @endif + +