whisper-money/app/Http/Controllers/Settings
Víctor Falcón e62f1d6aac
refactor(api): standardize serialization via model $hidden (#492)
## What

Standardizes how models are serialized across web, API, and Sync
responses by relying on Eloquent `$hidden` + accessors on the models
themselves, instead of ad-hoc `select` scopes and per-controller field
picking.

Touches 9 models (`Account`, `Bank`, `Budget`, `Category`, `Label`,
`LoanDetail`, `RealEstateDetail`, `Transaction`, plus pivot hiding) and
the controllers/middleware that consumed the old ad-hoc shapes.

## Why

- Single source of truth for response shape lives on the model, aligned
with Wayfinder model typegen.
- Removes duplicated field-selection logic scattered across controllers.
- Continues the duplication-removal PR series (#475–#483).

## How

- Hide internal columns and pivots via `$hidden`; expose computed fields
via accessors.
- Controllers return full models / load full relations rather than
hand-picked columns.
- `HandleInertiaRequests` slimmed down to match.

## Notes for reviewers

- Per-commit breakdown: each model standardized in its own commit for
easy review.
- Tests added/updated for each model to assert the serialized shape
(hidden columns absent, relations present).
- Full suite: 1382 passed / 1 skipped / 0 failed. `pint` clean.
2026-06-05 13:57:34 +02:00
..
AccountController.php refactor(api): standardize serialization via model $hidden (#492) 2026-06-05 13:57:34 +02:00
AutomationRuleApplicationController.php refactor(api): standardize serialization via model $hidden (#492) 2026-06-05 13:57:34 +02:00
AutomationRuleController.php Apply automation rules to existing transactions (#413) 2026-05-22 08:36:18 +02:00
BankController.php refactor(banks): add Bank::availableForUser scope (#480) 2026-06-03 17:59:24 +02:00
CategoryController.php feat: enable category tree for all users, remove flag (#488) 2026-06-04 13:44:57 +02:00
ChartColorSchemeController.php Add chart color scheme setting (#101) 2026-02-28 12:58:21 +01:00
LabelController.php refactor(api): standardize serialization via model $hidden (#492) 2026-06-05 13:57:34 +02:00
NetWorthChartLoanPreferenceController.php fix(dashboard): treat loans as debt in net worth (#238) 2026-03-20 09:55:53 +00:00
NetWorthChartRealEstatePreferenceController.php feat(accounts): add real estate asset tracking (#241) 2026-03-24 10:21:32 +00:00
NotificationPreferenceController.php feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00
PasswordController.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00
ProfileController.php feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00
TimezoneController.php fix(user): persist detected timezones (#296) 2026-04-16 11:36:57 +01:00
TwoFactorAuthenticationController.php Set up a fresh Laravel app 2025-11-07 12:01:36 +00:00