Replaces maryUI and daisyUI with nonameweb/livewire-material: the Vibrant indigo scheme, a system/light/dark theme under sealshare-theme, one top app bar with the account menu, the upload drop zone and link-ready moments, M3 fields, dialogs instead of wire:confirm, snackbars instead of flashed messages, a sortable admin table, and the starter-kit cleanup. Docker builds assets after Composer; CI drops the Flux step. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy
56 lines
1.8 KiB
PHP
56 lines
1.8 KiB
PHP
<?php
|
|
|
|
use App\Concerns\PasswordValidationRules;
|
|
use App\Livewire\Actions\Logout;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Livewire\Component;
|
|
|
|
new class extends Component {
|
|
use PasswordValidationRules;
|
|
|
|
public string $password = '';
|
|
public bool $showDeleteModal = 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);
|
|
}
|
|
}; ?>
|
|
|
|
<section class="mt-12 grid gap-4">
|
|
<x-divider />
|
|
|
|
<div>
|
|
<h3 class="type-title-md">{{ __('Delete account') }}</h3>
|
|
<p class="mt-1 type-body-md text-on-surface-variant">{{ __('Delete your account and all of its resources') }}</p>
|
|
</div>
|
|
|
|
<div>
|
|
<x-button :label="__('Delete account')" danger icon="delete" wire:click="$set('showDeleteModal', true)" data-test="delete-user-button" />
|
|
</div>
|
|
|
|
<x-modal wire:model="showDeleteModal" :title="__('Are you sure you want to delete your account?')" icon="delete">
|
|
<p>
|
|
{{ __('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.') }}
|
|
</p>
|
|
|
|
<form id="delete-user-form" wire:submit="deleteUser" class="mt-4">
|
|
<x-password wire:model="password" :label="__('Password')" autocomplete="current-password" />
|
|
</form>
|
|
|
|
<x-slot:actions>
|
|
<x-button :label="__('Cancel')" x-on:click="close()" />
|
|
<x-button type="submit" form="delete-user-form" :label="__('Delete account')" danger data-test="confirm-delete-user-button" />
|
|
</x-slot:actions>
|
|
</x-modal>
|
|
</section>
|