alex-bykovski/feature-manager-bundle
laravel-feature-flags) suggests this could be adapted or wrapped for Laravel via a custom facade or service provider. The core logic (feature state checks) is language-agnostic.FeatureEnabled, FeatureDisabled). If needed, this would require custom integration.laravel-feature-flags as a reference (similar API).Illuminate\Support\Facades\Cache).features with is_active, percentage, user_groups).Symfony\Component\HttpKernel\Bundle\Bundle in a Laravel app).AppServiceProvider).composer.json.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Laravel-Symfony Gap | High | Abstract core logic into a Laravel-friendly service. |
| Undocumented Storage | High | Assume database storage; design schema upfront. |
| No Event System | Medium | Extend with Laravel events (e.g., FeatureFlagUpdated). |
| Zero Adoption | Low | Fork and adapt if critical; otherwise, use Spatie’s package. |
| Performance | Low | Cache feature flags aggressively (e.g., Redis). |
FeatureManager::isActive('feature_name'))?AppServiceProvider (e.g., binding interfaces to Symfony implementations).FeatureGateMiddleware).@if(feature('name')) syntax.HttpKernel). Prefer Spatie’s package.features table with name, is_enabled, percentage, user_ids).Feature facade in Laravel:
namespace App\Facades;
use Illuminate\Support\Facades\Facade;
class Feature extends Facade {
protected static function getFacadeAccessor() { return 'feature.manager'; }
}
config/app.php (if hybrid) or mock its services.symfony/http-kernel polyfills.Cache::remember() for flag checks).Auth::user()->id for user-specific flags).feature_used events).features.name and user_ids for fast lookups.updated_at to features table to handle race conditions.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Database downtime | Feature flags unavailable | Fallback to config-based defaults. |
| Cache invalidation race | Stale flag values | Use Cache::forever() with tags. |
| Symfony service misconfiguration | Laravel app crashes | Isolate bundle in a separate process. |
| Permission leaks | Unauthorized feature access | Validate user roles in flag checks. |
@if(feature('name')) in Blade.Feature::enable('name', 50%)).How can I help you explore Laravel packages today?