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 mixed $user
|
||||||
* @param array $input
|
* @param array $input
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function update($user, array $input)
|
public function update($user, array $input)
|
||||||
{
|
{
|
||||||
Validator::make($input, [
|
Validator::make($input, [
|
||||||
'name' => ['required', 'string', 'max:255'],
|
'name' => ['required', 'string', 'max:255'],
|
||||||
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
|
'email' => ['email', 'max:255', Rule::unique('users')
|
||||||
|
->ignore($user->id)
|
||||||
|
],
|
||||||
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
|
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
|
||||||
])->validateWithBag('updateProfileInformation');
|
])
|
||||||
|
->validateWithBag('updateProfileInformation');
|
||||||
|
|
||||||
if (isset($input['photo'])) {
|
if (isset($input['photo'])) {
|
||||||
$user->updateProfilePhoto($input['photo']);
|
$user->updateProfilePhoto($input['photo']);
|
||||||
@@ -35,7 +39,8 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
|||||||
$user->forceFill([
|
$user->forceFill([
|
||||||
'name' => $input['name'],
|
'name' => $input['name'],
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
])->save();
|
])
|
||||||
|
->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +49,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
|||||||
*
|
*
|
||||||
* @param mixed $user
|
* @param mixed $user
|
||||||
* @param array $input
|
* @param array $input
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function updateVerifiedUser($user, array $input)
|
protected function updateVerifiedUser($user, array $input)
|
||||||
@@ -52,7 +58,8 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
|||||||
'name' => $input['name'],
|
'name' => $input['name'],
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
'email_verified_at' => null,
|
'email_verified_at' => null,
|
||||||
])->save();
|
])
|
||||||
|
->save();
|
||||||
|
|
||||||
$user->sendEmailVerificationNotification();
|
$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 id="email" type="email" class="mt-1 block w-full" wire:model.defer="state.email"/>
|
||||||
<x-jet-input-error for="email" class="mt-2"/>
|
<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">
|
<p class="text-sm mt-2">
|
||||||
{{ __('Your email address is unverified.') }}
|
{{ __('Your email address is unverified.') }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user