scripthost/app/Livewire/Auth/VerifyEmail.php
Javier Feliz 9b2b993418
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Setup
2025-07-22 17:49:01 -04:00

40 lines
909 B
PHP

<?php
namespace App\Livewire\Auth;
use App\Livewire\Actions\Logout;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Livewire\Attributes\Layout;
use Livewire\Component;
#[Layout('components.layouts.auth')]
class VerifyEmail extends Component
{
/**
* Send an email verification notification to the user.
*/
public function sendVerification(): void
{
if (Auth::user()->hasVerifiedEmail()) {
$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
return;
}
Auth::user()->sendEmailVerificationNotification();
Session::flash('status', 'verification-link-sent');
}
/**
* Log the current user out of the application.
*/
public function logout(Logout $logout): void
{
$logout();
$this->redirect('/', navigate: true);
}
}