File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
resources/views/livewire/settings Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 33namespace App \Livewire \Settings ;
44
55use App \Concerns \ProfileValidationRules ;
6- use App \ Models \ User ;
6+ use Illuminate \ Contracts \ Auth \ MustVerifyEmail ;
77use Illuminate \Support \Facades \Auth ;
88use Illuminate \Support \Facades \Session ;
9+ use Livewire \Attributes \Computed ;
910use Livewire \Component ;
1011
1112class Profile extends Component
@@ -62,4 +63,17 @@ public function resendVerificationNotification(): void
6263
6364 Session::flash ('status ' , 'verification-link-sent ' );
6465 }
66+
67+ #[Computed]
68+ public function hasUnverifiedEmail (): bool
69+ {
70+ return Auth::user () instanceof MustVerifyEmail && ! Auth::user ()->hasVerifiedEmail ();
71+ }
72+
73+ #[Computed]
74+ public function showDeleteUser (): bool
75+ {
76+ return ! Auth::user () instanceof MustVerifyEmail
77+ || (Auth::user () instanceof MustVerifyEmail && Auth::user ()->hasVerifiedEmail ());
78+ }
6579}
Original file line number Diff line number Diff line change 1010 <div >
1111 <flux:input wire:model =" email" :label =" __('Email')" type =" email" required autocomplete =" email" />
1212
13- @if (auth () -> user () instanceof \Illuminate\Contracts\Auth\ MustVerifyEmail && ! auth () -> user () -> hasVerifiedEmail () )
13+ @if ($this -> hasUnverifiedEmail )
1414 <div >
1515 <flux:text class =" mt-4" >
1616 {{ __ (' Your email address is unverified.' ) } }
4040 </div >
4141 </form >
4242
43- @if (
44- ! auth ()-> user () instanceof \Illuminate\Contracts\Auth\ MustVerifyEmail
45- || (auth ()-> user () instanceof \Illuminate\Contracts\Auth\ MustVerifyEmail && auth ()-> user ()-> hasVerifiedEmail ())
46- )
47- <livewire .settings.delete-user-form />
43+ @if ($this -> showDeleteUser )
44+ <livewire:settings .delete-user-form />
4845 @endif
4946 </x-settings .layout >
5047</section >
You can’t perform that action at this time.
0 commit comments