## Summary - Batch-load all Pennant feature flags via `Feature::load()` in `HandleInertiaRequests`, reducing 3 individual SELECT+INSERT pairs (6 queries) to 1 batched SELECT + 1 bulk INSERT (2 queries) - Batch `activate()` calls in `ActivateDevelopmentFeatures` middleware using array syntax for a single UPSERT instead of 3 ## Context PR #241 (real estate feature) added a new Pennant feature flag check to the shared Inertia data, pushing the top categories API endpoint from 12 to 13 queries and breaking the performance test threshold. ## Query impact | Scenario | Before | After | |---|---|---| | Feature flag queries per request | 6 (3 SELECT + 3 INSERT) | 2 (1 SELECT + 1 INSERT) | | Top categories API total | 13 | 9 | | Future-proof | +2 queries per new flag | Constant regardless of flag count | |
||
|---|---|---|
| .. | ||
| ActivateDevelopmentFeatures.php | ||
| BlockDemoAccountActions.php | ||
| DisableRegistrationWhenHidden.php | ||
| EnsureOnboardingComplete.php | ||
| EnsureOpenBankingFeature.php | ||
| EnsureUserIsSubscribed.php | ||
| HandleAppearance.php | ||
| HandleInertiaRequests.php | ||
| SetLocale.php | ||
| WithoutSsr.php | ||