mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
profile update changed
This commit is contained in:
@@ -14,15 +14,19 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
||||
*
|
||||
* @param mixed $user
|
||||
* @param array $input
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function update($user, array $input)
|
||||
{
|
||||
Validator::make($input, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['email', 'max:255', Rule::unique('users')
|
||||
->ignore($user->id)
|
||||
],
|
||||
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
|
||||
])->validateWithBag('updateProfileInformation');
|
||||
])
|
||||
->validateWithBag('updateProfileInformation');
|
||||
|
||||
if (isset($input['photo'])) {
|
||||
$user->updateProfilePhoto($input['photo']);
|
||||
@@ -33,9 +37,10 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
||||
$this->updateVerifiedUser($user, $input);
|
||||
} else {
|
||||
$user->forceFill([
|
||||
'name' => $input['name'],
|
||||
'name' => $input['name'],
|
||||
'email' => $input['email'],
|
||||
])->save();
|
||||
])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,15 +49,17 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
||||
*
|
||||
* @param mixed $user
|
||||
* @param array $input
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function updateVerifiedUser($user, array $input)
|
||||
{
|
||||
$user->forceFill([
|
||||
'name' => $input['name'],
|
||||
'email' => $input['email'],
|
||||
'name' => $input['name'],
|
||||
'email' => $input['email'],
|
||||
'email_verified_at' => null,
|
||||
])->save();
|
||||
])
|
||||
->save();
|
||||
|
||||
$user->sendEmailVerificationNotification();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<x-jet-input id="email" type="email" class="mt-1 block w-full" wire:model.defer="state.email"/>
|
||||
<x-jet-input-error for="email" class="mt-2"/>
|
||||
|
||||
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::emailVerification()) && ! $this->user->hasVerifiedEmail())
|
||||
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::emailVerification()) && !$this->user->hasVerifiedEmail() && $this->user->email)
|
||||
<p class="text-sm mt-2">
|
||||
{{ __('Your email address is unverified.') }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user