whisper-money/app/Http/Requests/Settings
Víctor Falcón cc63a86a1c
refactor(requests): extract user-owned exists rules to trait (#477)
## What

The `Rule::exists('x', 'id')->where(fn => user_id)` ownership closure
was repeated **19×** across 10 Form Requests (categories, labels,
accounts, typed accounts).

New `app/Http/Requests/Concerns/ValidatesUserOwnedResources` trait:

- `$this->userOwned('categories' | 'labels' | 'accounts')`
- `$this->userOwnedAccountOfType(AccountType::Loan | RealEstate)`

`UpdateAutomationRuleRequest` intentionally untouched — #476 makes it
extend Store.

## Stats

- **-110 / +63 lines**

## Checks

- `php artisan test
--filter="Transaction|Budget|Account|AutomationRule|RealEstate|Loan"` —
641 passed (3052 assertions), 1 skipped
- `vendor/bin/pint --dirty` — pass

Part of duplication-removal series (#475, #476).
2026-06-03 17:33:54 +02:00
..
ApplyAutomationRuleRequest.php Apply automation rules to existing transactions (#413) 2026-05-22 08:36:18 +02:00
ProfileUpdateRequest.php feat(settings): centralize currency options and split profile/account support (#256) 2026-04-02 19:23:10 +02:00
StoreAccountRequest.php refactor(requests): extract user-owned exists rules to trait (#477) 2026-06-03 17:33:54 +02:00
StoreAutomationRuleRequest.php refactor(requests): extract user-owned exists rules to trait (#477) 2026-06-03 17:33:54 +02:00
StoreBankRequest.php Accounts: Allow users to create custom banks with his own logo, and name (#12) 2025-12-04 15:24:04 +01:00
StoreCategoryRequest.php fix(categories): expose cashflow setting on create (#448) 2026-05-29 11:05:04 +02:00
StoreLabelRequest.php feat: add transaction labels feature (#24) 2025-12-13 13:02:19 +01:00
TwoFactorAuthenticationRequest.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
UpdateAccountRequest.php refactor(requests): extract user-owned exists rules to trait (#477) 2026-06-03 17:33:54 +02:00
UpdateAutomationRuleRequest.php refactor(requests): dedupe UpdateAutomationRuleRequest (#476) 2026-06-03 17:29:23 +02:00
UpdateCategoryRequest.php fix(categories): expose cashflow setting on create (#448) 2026-05-29 11:05:04 +02:00
UpdateChartColorSchemeRequest.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
UpdateLabelRequest.php feat: add transaction labels feature (#24) 2025-12-13 13:02:19 +01:00
UpdateNetWorthChartLoanPreferenceRequest.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
UpdateNetWorthChartRealEstatePreferenceRequest.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
UpdateNotificationPreferencesRequest.php feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00
UpdateTimezoneRequest.php fix(user): persist detected timezones (#296) 2026-04-16 11:36:57 +01:00