- Replaced deprecated `flux` components with `maryUI` counterparts (`flux:input` → `x-mary-input`, `flux:button` → `x-mary-button`, etc.). - Removed unused partials (`settings-heading.blade.php`) and outdated structures from Blade files. - Adjusted Livewire modal, form, and button implementations for consistency with `maryUI`. - Streamlined layout and theme styling for improved maintainability and readability.
34 lines
695 B
PHP
34 lines
695 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Livewire\Settings;
|
|
|
|
use App\Concerns\PasswordValidationRules;
|
|
use App\Livewire\Actions\Logout;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Livewire\Component;
|
|
|
|
final class DeleteUserForm extends Component
|
|
{
|
|
use PasswordValidationRules;
|
|
|
|
public string $password = '';
|
|
|
|
public bool $confirmingUserDeletion = false;
|
|
|
|
/**
|
|
* Delete the currently authenticated user.
|
|
*/
|
|
public function deleteUser(Logout $logout): void
|
|
{
|
|
$this->validate([
|
|
'password' => $this->currentPasswordRules(),
|
|
]);
|
|
|
|
tap(Auth::user(), $logout(...))->delete();
|
|
|
|
$this->redirect('/', navigate: true);
|
|
}
|
|
}
|