## What The "public banks + user's own banks" query was repeated in **5 controllers** (Transaction ×2, Settings/Bank, Budget, Cashflow, Onboarding). New `Bank::availableForUser($user)` scope; all 5 sites use it. Bonus: the Onboarding variant had no `where()` grouping around `whereNull/orWhere` — harmless today (no other constraints) but a latent precedence bug. The scope always groups. ## Stats - **-31 / +24 lines**, 5 call sites → 1 definition ## Checks - `php artisan test --filter="Bank|Transaction|Budget|Cashflow|Onboarding"` — 612 passed (2707 assertions), 1 skipped - `vendor/bin/pint --dirty` — pass Part of duplication-removal series (#475–#479). |
||
|---|---|---|
| .. | ||
| Controllers | ||
| Middleware | ||
| Requests | ||
| Responses | ||