51 lines
2.0 KiB
PHP
51 lines
2.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Password;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Volt\Component;
|
|
|
|
new #[Layout('layouts.guest')] class extends Component
|
|
{
|
|
public string $email = '';
|
|
|
|
public function sendPasswordResetLink(): void
|
|
{
|
|
$this->validate(['email' => ['required', 'string', 'email']]);
|
|
|
|
$status = Password::sendResetLink($this->only('email'));
|
|
|
|
if ($status != Password::RESET_LINK_SENT) {
|
|
$this->addError('email', __($status));
|
|
return;
|
|
}
|
|
|
|
$this->reset('email');
|
|
session()->flash('status', __($status));
|
|
}
|
|
}; ?>
|
|
|
|
<div>
|
|
<h2 style="font-size:1.25rem;font-weight:600;color:#f0f0f5;margin-bottom:0.75rem;">Reset password</h2>
|
|
<p style="font-size:0.875rem;color:#8888a0;margin-bottom:1.5rem;">Enter your email and we'll send a reset link.</p>
|
|
|
|
<x-auth-session-status class="mb-4" :status="session('status')" />
|
|
|
|
<form wire:submit="sendPasswordResetLink">
|
|
<div>
|
|
<label for="email" style="display:block;font-size:0.875rem;color:#8888a0;margin-bottom:0.375rem;">Email</label>
|
|
<input wire:model="email" id="email" type="email" name="email" required autofocus
|
|
style="width:100%;padding:0.5rem 0.75rem;background-color:#111117;border:1px solid rgba(255,255,255,0.06);border-radius:0.5rem;color:#f0f0f5;outline:none;"
|
|
onfocus="this.style.borderColor='#4f8ef7'" onblur="this.style.borderColor='rgba(255,255,255,0.06)'" />
|
|
<x-input-error :messages="$errors->get('email')" class="mt-2" />
|
|
</div>
|
|
|
|
<div style="display:flex;justify-content:flex-end;margin-top:1.5rem;">
|
|
<button type="submit"
|
|
style="padding:0.5rem 1.5rem;background-color:#4f8ef7;color:#fff;border:none;border-radius:0.5rem;font-weight:500;cursor:pointer;"
|
|
onmouseover="this.style.opacity='.9'" onmouseout="this.style.opacity='1'">
|
|
Send reset link
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|