- How do I install stogon/unleash-bundle in a Laravel application?
- Run composer require stogon/unleash-bundle:^1.0.1, publish the config file, and set the UNLEASH_URL and UNLEASH_API_TOKEN environment variables along with your application or environment name. Then inject the FeatureRepository wherever you need flag checks. Expected effort is hours rather than weeks: no data migration, no schema change, and no rewrite of existing code. Explicitly exclude 1.0.0 if an internal template or lockfile still pins it.
- Which Laravel and PHP versions does stogon/unleash-bundle support?
- The package targets Laravel 9, 10 and 11 on PHP 8.1 or newer, which matches the PHP 8 named-argument behaviour used in its container bindings. Before committing, check the illuminate/support constraint in the package composer.json against your exact Laravel version and confirm the transitive Unleash PHP SDK version is compatible. The project has a short release history, so verify the CI matrix rather than assuming broad version coverage.
- How do I check whether a feature flag is enabled in Laravel?
- Type-hint the FeatureRepository in a constructor or method signature and call isEnabled() with the flag name; a facade is also available if you prefer static access. Evaluation is delegated to the Unleash PHP SDK, so the flag must exist in the Unleash project tied to your API token and environment. Check the README for the exact namespace and method signature before wiring it into controllers or middleware.
- What changed in version 1.0.1 and should I upgrade from 1.0.0?
- Version 1.0.1 fixes two container-wiring defects: a FeatureRepository binding that used an invalid named argument, and an UnleashHttpClient that received the wrong HttpClientInterface instance. Those are boot-time defects, so 1.0.0 could fail to resolve its own object graph or silently inject the wrong client. Treat the patch as a required upgrade; it adds no new surface area, deprecations or breaking changes.
- Does feature flag evaluation hit the Unleash API on every request, and is it cached?
- This is the key design question and it is not resolved by the 1.0.1 release. If isEnabled() performs synchronous HTTP against the Unleash API on the request path, every request that reads a flag gains a network dependency that affects latency and availability. Check whether the package or the underlying SDK caches flag payloads, and confirm the TTL and invalidation strategy before relying on it in high-traffic code paths.
- What happens when the Unleash server is unreachable?
- Verify the documented behaviour against the SDK rather than assuming it, because the failure mode determines your blast radius. The three plausible outcomes are a default-false evaluation, a thrown exception, or serving a last-known-good cached payload. For production, decide explicitly which policy you need and wrap the repository if the package default does not match it.
- How do I configure stogon/unleash-bundle with environment variables?
- Publish the package config and set UNLEASH_URL, UNLEASH_API_TOKEN, plus the environment or application name in your .env file. Keep the token out of version control and use a different token per environment so staging toggles never affect production. No migrations or schema changes are required, which keeps the setup reversible if you remove the package later.
- How do I test code that reads feature flags without a live Unleash server?
- Swap the bound repository for a fake or stub implementation in the test container so flag reads resolve locally without network calls. Avoid hitting a real Unleash instance from your test suite, since it introduces flakiness and shared state between runs. If the package ships no no-op client, a small binding override in a test service provider is enough to keep tests fast and deterministic.
- Is stogon/unleash-bundle production-ready and how actively is it maintained?
- At v1.0.1 with a very short release history, treat the package as an emerging dependency rather than a proven one. Both patch fixes addressed the service provider's own wiring, which suggests it had not been exercised end to end in a realistic host application. Pin an exact version, review the commit and issue-response history, and keep a fallback such as Laravel Pennant if maintenance stalls.
- What are the alternatives to stogon/unleash-bundle for Laravel feature flags?
- Laravel Pennant provides first-party feature flags with array or database drivers and needs no external service. If you specifically want Unleash, you can use the Unleash PHP SDK directly and bind the FeatureRepository into the container yourself in a handful of lines. Other Unleash clients exist, but they will not give you the Laravel service provider and publishable config this package offers.