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
61 lines
2.1 KiB
PHP
61 lines
2.1 KiB
PHP
<?php
|
|
|
|
use App\Concerns\PasswordValidationRules;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Validation\Rules\Password;
|
|
use Illuminate\Validation\ValidationException;
|
|
use Livewire\Component;
|
|
use NoNameWeb\LivewireMaterial\Concerns\Toasts;
|
|
|
|
new class extends Component {
|
|
use PasswordValidationRules;
|
|
use Toasts;
|
|
|
|
public string $current_password = '';
|
|
public string $password = '';
|
|
public string $password_confirmation = '';
|
|
|
|
/**
|
|
* Update the password for the currently authenticated user.
|
|
*/
|
|
public function updatePassword(): void
|
|
{
|
|
try {
|
|
$validated = $this->validate([
|
|
'current_password' => $this->currentPasswordRules(),
|
|
'password' => $this->passwordRules(),
|
|
]);
|
|
} catch (ValidationException $e) {
|
|
$this->reset('current_password', 'password', 'password_confirmation');
|
|
|
|
throw $e;
|
|
}
|
|
|
|
Auth::user()->update([
|
|
'password' => $validated['password'],
|
|
]);
|
|
|
|
$this->reset('current_password', 'password', 'password_confirmation');
|
|
|
|
$this->dispatch('password-updated');
|
|
|
|
$this->success(__('Saved.'));
|
|
}
|
|
}; ?>
|
|
|
|
<section class="w-full">
|
|
@include('partials.settings-heading')
|
|
|
|
<x-pages::settings.layout :heading="__('Update password')" :subheading="__('Ensure your account is using a long, random password to stay secure')">
|
|
<form method="POST" wire:submit="updatePassword" class="grid gap-5">
|
|
<x-password wire:model="current_password" :label="__('Current password')" required autocomplete="current-password" />
|
|
<x-password wire:model="password" :label="__('New password')" required autocomplete="new-password" />
|
|
<x-password wire:model="password_confirmation" :label="__('Confirm Password')" required autocomplete="new-password" />
|
|
|
|
<div>
|
|
<x-button type="submit" :label="__('Save')" variant="filled" spinner="updatePassword" data-test="update-password-button" />
|
|
</div>
|
|
</form>
|
|
</x-pages::settings.layout>
|
|
</section>
|