feature_toggles table.FeatureToggled) for observability or side effects (e.g., analytics).Auth::user() for user-specific toggles).Feature::enabled('new-ui')).FeatureToggleServiceProvider and publish config/migrations.ToggleRepository interface.php artisan vendor:publish --provider="EricDowell\FeatureToggle\FeatureToggleServiceProvider").config/feature-toggle.php.Feature::enabled() calls.Feature::enabledForUser('new-dashboard', fn($user) => $user->isPremium())).FeatureToggle facade or use Feature::shouldReturn() for deterministic testing).feature/new-ui/v2).Feature::evaluate() to inspect rules.Feature::enabled('x') calls) for observability.php artisan cache:clear) or implement cache invalidation on toggle updates.Feature::enabled() in a loop under load.feature_toggles table on name and conditions columns if using complex queries.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Database downtime | Toggles unavailable (fallback to config defaults). | Use a hybrid cache+config fallback (e.g., Feature::fallbackToConfig(true)). |
| Cache corruption | Stale toggle values. | Implement cache health checks; use Feature::clearCache() in health endpoints. |
| Toggle misconfiguration | Unexpected feature behavior. | Use feature flag analytics to monitor toggle usage. |
| Remote backend API failures | Toggles unavailable. | Implement retry logic or local caching with stale-while-revalidate. |
| Permission denied (DB access) | Toggle evaluation fails silently. | Monitor Illuminate\Database\QueryException; alert on toggle-related errors. |
Feature::enabled(), conditions, variants).How can I help you explore Laravel packages today?