- Event-Medien tragen Typ (image/video/audio), Dauer und Notiz; Videos bekommen ein Poster, Audio wird per ffmpeg nach AAC (audio/mp4) gewandelt, Originale werden mit Range-Unterstützung gestreamt. - Upload nimmt eine Notiz (caption) direkt mit, PATCH ändert sie später. - Neue Event-Felder: Zeitraum (end_date), Kategorie, Personen, Meilenstein. Regeln zentral in EventFields, damit CRUD und Sync gleich prüfen. - Titel darf leer sein: ein Event entsteht mit dem ersten Eintrag. - Artisan-Befehl media:transcode-voice-notes wandelt alte WebM/Ogg-Notizen, die Safari nicht abspielen kann. - Login-Throttling, Settings-Validierung, Sync-Fehlercodes ohne Rohtext. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
65 lines
2.3 KiB
PHP
65 lines
2.3 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Actions\Logout;
|
|
use App\Services\MediaCleaner;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Livewire\Volt\Component;
|
|
|
|
new class extends Component {
|
|
public string $password = '';
|
|
|
|
/**
|
|
* Delete the currently authenticated user.
|
|
*/
|
|
public function deleteUser(Logout $logout, MediaCleaner $mediaCleaner): void
|
|
{
|
|
$this->validate([
|
|
'password' => ['required', 'string', 'current_password'],
|
|
]);
|
|
|
|
$user = Auth::user();
|
|
|
|
// Rows vanish through the database cascade; the files behind them
|
|
// have to be collected and removed before that happens.
|
|
$mediaCleaner->purgeUserMedia($user);
|
|
|
|
tap($user, $logout(...))->delete();
|
|
|
|
$this->redirect('/', navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<section class="mt-10 space-y-6">
|
|
<div class="relative mb-5">
|
|
<flux:heading>{{ __('Delete account') }}</flux:heading>
|
|
<flux:subheading>{{ __('Delete your account and all of its resources') }}</flux:subheading>
|
|
</div>
|
|
|
|
<flux:modal.trigger name="confirm-user-deletion">
|
|
<flux:button variant="danger" x-data="" x-on:click.prevent="$dispatch('open-modal', 'confirm-user-deletion')">
|
|
{{ __('Delete account') }}
|
|
</flux:button>
|
|
</flux:modal.trigger>
|
|
|
|
<flux:modal name="confirm-user-deletion" :show="$errors->isNotEmpty()" focusable class="max-w-lg">
|
|
<form wire:submit="deleteUser" class="space-y-6">
|
|
<div>
|
|
<flux:heading size="lg">{{ __('Are you sure you want to delete your account?') }}</flux:heading>
|
|
|
|
<flux:subheading>
|
|
{{ __('Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.') }}
|
|
</flux:subheading>
|
|
</div>
|
|
|
|
<flux:input wire:model="password" :label="__('Password')" type="password" />
|
|
|
|
<div class="flex justify-end space-x-2">
|
|
<flux:modal.close>
|
|
<flux:button variant="filled">{{ __('Cancel') }}</flux:button>
|
|
</flux:modal.close>
|
|
|
|
<flux:button variant="danger" type="submit">{{ __('Delete account') }}</flux:button>
|
|
</div>
|
|
</form>
|
|
</flux:modal>
|
|
</section>
|