verify-email.blade.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. use App\Livewire\Actions\Logout;
  3. use Illuminate\Support\Facades\Auth;
  4. use Illuminate\Support\Facades\Session;
  5. use Livewire\Attributes\Layout;
  6. use Livewire\Volt\Component;
  7. new #[Layout('layouts.guest')] class extends Component
  8. {
  9. /**
  10. * Send an email verification notification to the user.
  11. */
  12. public function sendVerification(): void
  13. {
  14. if (Auth::user()->hasVerifiedEmail()) {
  15. $this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
  16. return;
  17. }
  18. Auth::user()->sendEmailVerificationNotification();
  19. Session::flash('status', 'verification-link-sent');
  20. }
  21. /**
  22. * Log the current user out of the application.
  23. */
  24. public function logout(Logout $logout): void
  25. {
  26. $logout();
  27. $this->redirect('/', navigate: true);
  28. }
  29. }; ?>
  30. <div>
  31. <div class="mb-4 text-sm text-gray-600 dark:text-gray-400">
  32. {{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }}
  33. </div>
  34. @if (session('status') == 'verification-link-sent')
  35. <div class="mb-4 font-medium text-sm text-green-600 dark:text-green-400">
  36. {{ __('A new verification link has been sent to the email address you provided during registration.') }}
  37. </div>
  38. @endif
  39. <div class="mt-4 flex items-center justify-between">
  40. <x-primary-button wire:click="sendVerification">
  41. {{ __('Resend Verification Email') }}
  42. </x-primary-button>
  43. <button wire:click="logout" type="submit" class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">
  44. {{ __('Log Out') }}
  45. </button>
  46. </div>
  47. </div>