ylsideas/feature-flags
Extensible feature flags for Laravel to safely toggle code and features. Manage flags in application logic, routes, Blade views, scheduler tasks, and validation rules to support continuous integration and controlled rollouts.
Strengths:
feature:state command, fake flags) simplify testing and observability.Weaknesses:
Laravel Compatibility:
Key Integrations:
whenFeatureIsAccessible()/whenFeatureIsNotAccessible() for conditional queries.FeatureFlagRule for form-level gating.shouldRun() for task scheduling.@if(Features::accessible('flag')) directives.FeatureFlagMiddleware for route-level access control.Non-Laravel Systems:
GET /api/features) for SPAs.Features::fake('new-feature', true)).Critical Risks:
Mitigation Strategies:
Features::fake() in tests).chain driver to fall back to a database if cache fails.Open Questions:
Ideal for:
Less Ideal for:
Assessment Phase:
Pilot Phase:
whenFeatureIsAccessible()) in critical paths.Full Adoption:
Features::accessible()).Optimization:
Laravel Versions:
Dependencies:
predis/predis for Redis).Conflicts:
Feature models/classes.FeatureFlagMiddleware should run early).composer require ylsideas/feature-flags:^3.0
php artisan vendor:publish --provider="YlsIdeas\FeatureFlags\FeatureFlagsServiceProvider" --tag=config
default driver (e.g., cache, database, or chain).features.php flags (e.g., new-payments-system: false).Features::fake('flag', true) in tests.Pros:
config/features.php or a database.Cons:
Troubleshooting:
app/Http/Kernel.php.Debugging Tools:
php artisan feature:state to inspect flag values.Features::fake() for local testing.LogFeatureAccessGateway).Escalation Path:
Performance:
Load Testing:
Features::accessible() latency under load (target: <5ms p99).**Failure M
How can I help you explore Laravel packages today?