lasthourcloud/app/Livewire/VerifyEmail.php

31 lines
593 B
PHP
Raw Permalink Normal View History

2023-10-09 12:20:55 +00:00
<?php
2023-12-07 18:06:32 +00:00
namespace App\Livewire;
2023-10-09 12:20:55 +00:00
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
2024-06-10 20:43:34 +00:00
use Livewire\Component;
2023-10-09 12:20:55 +00:00
class VerifyEmail extends Component
{
use WithRateLimiting;
2024-06-10 20:43:34 +00:00
public function again()
{
2023-10-09 12:20:55 +00:00
try {
$this->rateLimit(1, 300);
auth()->user()->sendVerificationEmail();
2023-12-07 18:06:32 +00:00
$this->dispatch('success', 'Email verification link sent!');
2023-10-09 12:20:55 +00:00
2024-06-10 20:43:34 +00:00
} catch (\Exception $e) {
2023-10-09 12:20:55 +00:00
ray($e);
2024-06-10 20:43:34 +00:00
return handleError($e, $this);
2023-10-09 12:20:55 +00:00
}
}
2024-06-10 20:43:34 +00:00
2023-10-09 12:20:55 +00:00
public function render()
{
return view('livewire.verify-email');
}
}