Laravel 11 + Livewire 3/Volt + Alpine.js + Tailwind app for household budget planning, transaction tracking, and financial dashboards. - Multi-tenant households with member invites - Plan: monthly/yearly budget per category with overrides - Suivi: transaction log with running balance (desktop + mobile quick-entry) - Dashboard: budget vs tracked breakdown + Chart.js donuts - Flux: Sankey diagram of income allocation - WCAG 2.1 AA color tokens, dark mode, accessible tables/forms - 50 Pest tests Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
63 lines
1.7 KiB
PHP
63 lines
1.7 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Validation\ValidationException;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Volt\Component;
|
|
|
|
new #[Layout('layouts.guest')] class extends Component
|
|
{
|
|
public string $password = '';
|
|
|
|
/**
|
|
* Confirm the current user's password.
|
|
*/
|
|
public function confirmPassword(): void
|
|
{
|
|
$this->validate([
|
|
'password' => ['required', 'string'],
|
|
]);
|
|
|
|
if (! Auth::guard('web')->validate([
|
|
'email' => Auth::user()->email,
|
|
'password' => $this->password,
|
|
])) {
|
|
throw ValidationException::withMessages([
|
|
'password' => __('auth.password'),
|
|
]);
|
|
}
|
|
|
|
session(['auth.password_confirmed_at' => time()]);
|
|
|
|
$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<div>
|
|
<div class="mb-4 text-sm text-text-muted">
|
|
{{ __('This is a secure area of the application. Please confirm your password before continuing.') }}
|
|
</div>
|
|
|
|
<form wire:submit="confirmPassword">
|
|
<!-- Password -->
|
|
<div>
|
|
<x-input-label for="password" :value="__('Password')" />
|
|
|
|
<x-text-input wire:model="password"
|
|
id="password"
|
|
class="block mt-1 w-full"
|
|
type="password"
|
|
name="password"
|
|
required autocomplete="current-password" />
|
|
|
|
<x-input-error :messages="$errors->get('password')" class="mt-2" />
|
|
</div>
|
|
|
|
<div class="flex justify-end mt-4">
|
|
<x-primary-button>
|
|
{{ __('Confirm') }}
|
|
</x-primary-button>
|
|
</div>
|
|
</form>
|
|
</div>
|