Projektgrundlage: Laravel 13 mit Livewire-Starter-Kit und Sail
- Livewire-Starter-Kit (Livewire 4, Flux, Fortify) mit Pest - Sail mit PHP 8.5, MySQL 8.4, Redis, Meilisearch 1.54.2, Mailpit - Registrierung deaktiviert, 2FA und Passkeys verfügbar - Spatie laravel-permission - gitleaks als Pre-Commit-Hook (.githooks) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Settings;
|
||||
|
||||
use App\Concerns\PasswordValidationRules;
|
||||
use App\Livewire\Actions\Logout;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
|
||||
class DeleteUserForm extends Component
|
||||
{
|
||||
use PasswordValidationRules;
|
||||
|
||||
public string $password = '';
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user