Inicio de sesion y probando con octane + frankenphp
This commit is contained in:
44
app/Livewire/Auth/ForgotPassword.php
Normal file
44
app/Livewire/Auth/ForgotPassword.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Auth;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Livewire\Attributes\Layout;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use TallStackUi\Traits\Interactions;
|
||||
|
||||
#[Layout('components.layouts.login')]
|
||||
class ForgotPassword extends Component
|
||||
{
|
||||
use Interactions;
|
||||
|
||||
#[Validate('required|email')]
|
||||
public $email = '';
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('livewire.auth.forgot-password');
|
||||
}
|
||||
|
||||
public function recover(): void
|
||||
{
|
||||
$this->validate();
|
||||
|
||||
$status = Password::sendResetLink(['email' => $this->email]);
|
||||
|
||||
if ($status === Password::RESET_LINK_SENT) {
|
||||
$this->dialog()->success('Correo enviado', __($status))
|
||||
->confirm(method: 'redirectToLogin')
|
||||
->send();
|
||||
} else {
|
||||
$this->dialog()->error('Error', __($status))->send();
|
||||
}
|
||||
}
|
||||
|
||||
public function redirectToLogin(): void
|
||||
{
|
||||
$this->redirect(route('login'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user