39 lines
824 B
PHP
39 lines
824 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Auth;
|
|
|
|
use App\Traits\WithToast;
|
|
use Illuminate\Support\Facades\Password;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Attributes\Validate;
|
|
use Livewire\Component;
|
|
|
|
#[Layout('components.layouts.auth', [
|
|
'title' => 'Lupa Kata Sandi',
|
|
])]
|
|
class ForgotPassword extends Component
|
|
{
|
|
use WithToast;
|
|
|
|
#[Validate(['required', 'string'])]
|
|
public string $email = '';
|
|
|
|
public function sendLink()
|
|
{
|
|
$this->validate();
|
|
|
|
$status = Password::sendResetLink(
|
|
$this->only('email')
|
|
);
|
|
|
|
return $status === Password::ResetLinkSent
|
|
? $this->toast(__($status), 'Berhasil')
|
|
: $this->toast(__($status), 'Gagal', 'danger');
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.auth.forgot-password');
|
|
}
|
|
}
|