name = Auth::user()->name; $this->email = Auth::user()->email; } /** * Update the profile information for the currently authenticated user. */ public function updateProfileInformation(): void { $user = Auth::user(); $validated = $this->validate($this->profileRules($user->id)); $user->fill($validated); if ($user->isDirty('email')) { $user->email_verified_at = null; } $user->save(); Flux::toast(variant: 'success', text: __('Profile updated.')); } /* @chisel-email-verification */ /** * Send an email verification notification to the current user. */ public function resendVerificationNotification(): void { $user = Auth::user(); if ($user->hasVerifiedEmail()) { $this->redirectIntended(default: route('dashboard', absolute: false)); return; } $user->sendEmailVerificationNotification(); Session::flash('status', 'verification-link-sent'); } #[Computed] public function hasUnverifiedEmail(): bool { return Auth::user() instanceof MustVerifyEmail && ! Auth::user()->hasVerifiedEmail(); } #[Computed] public function showDeleteUser(): bool { return ! Auth::user() instanceof MustVerifyEmail || (Auth::user() instanceof MustVerifyEmail && Auth::user()->hasVerifiedEmail()); } /* @end-chisel-email-verification */ }; ?>
@include('partials.settings-heading') {{ __('Profile settings') }}
{{-- @chisel-email-verification --}} @if ($this->hasUnverifiedEmail)
{{ __('Your email address is unverified.') }} {{ __('Click here to re-send the verification email.') }} @if (session('status') === 'verification-link-sent') {{ __('A new verification link has been sent to your email address.') }} @endif
@endif {{-- @end-chisel-email-verification --}}
{{ __('Save') }}
{{-- @chisel-email-verification --}} @if ($this->showDeleteUser) {{-- @end-chisel-email-verification --}} {{-- @chisel-email-verification --}} @endif {{-- @end-chisel-email-verification --}}