Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Toggle Laravel Package

qandidate/toggle

Qandidate Toggle is a PHP library for managing feature toggles (feature flags) in your applications. Define toggles, activate them conditionally with strategies, and roll features out safely without redeploying code.

View on GitHub
Deep Wiki
Context7

Qandidate Toggle is a PHP library for adding feature toggles to applications, letting you enable or disable functionality without deploying new code. Toggles are defined with reusable conditions and evaluated against a runtime context, making it easy to roll out features gradually or target specific users.

  • Define named toggles and activate/deactivate them programmatically
  • Build toggle conditions from composable operators
  • Evaluate toggles with request-specific context
  • Persist toggle state via configurable storage
  • Integrate with Symfony through the dedicated bundle
Frequently asked questions about Toggle
How do I install qandidate/toggle in a Laravel app?
Install it with Composer using composer require qandidate/toggle. The package has no Laravel auto-discovery, so expect to write glue: a service provider, a config file, a facade or application-owned contract, and a repository wired to Redis or another store. A production-credible wrapper with tests is roughly one to three engineer-days if Redis is already available.
Does qandidate/toggle work with Laravel 11 and PHP 8.3?
It is a framework-agnostic PHP library from the PHP 7 generation, so there is no Laravel 11-specific integration. Check the composer.json constraints for PHP versions and Predis or ext-redis majors against your baseline, then run the package under PHP 8.2 or 8.3 to catch deprecation notices. If notices appear, treat that as a fork-and-patch decision rather than a blocker.
How should I bind qandidate/toggle in Laravel's service container?
Do not call the package directly from controllers or models. Define an application-owned contract such as App\FeatureFlags\Flags with an active(string $flag, array $context = []): bool method, implement it with qandidate internally, and bind the repository in a service provider. That costs about half a day and gives you one place for caching, logging, fail-open or fail-closed behaviour, and future replacement.
Where does qandidate/toggle store toggle definitions?
It exposes a ToggleRepository abstraction with in-memory and key-value or Redis-style implementations. There is no HTTP layer, admin API, audit trail or event system, so persistence and management are your responsibility. Choose the repository that matches your infrastructure and wire it to your Redis instance in the service provider.
Can qandidate/toggle handle percentage rollouts and sticky bucketing for A/B tests?
The condition model is operator plus key plus operand, evaluated against a context array, which is attribute-comparison oriented. Verify whether percentage rollouts, sticky bucketing, prerequisite flags and evaluation analytics exist before committing. If they do not, use the library for release, ops and entitlement flags only, not growth experiments or A/B testing.
How do I stop qandidate/toggle from hitting Redis once per flag per request?
Naive usage means one store round-trip per flag per request, which becomes a latency and Redis-load problem at scale. Add request-scoped memoisation in your wrapper and check whether the repository interface supports batch-loading the whole toggle set in one call. That is the pattern you need for per-request caching without changing call sites.
Is qandidate/toggle safe with Laravel Octane and long-lived queue workers?
Only if you avoid caching flags in a singleton for the life of the worker. Long-lived workers such as Octane and queue consumers will otherwise serve stale or cross-tenant flag state after a toggle changes. Keep memoisation request-scoped, or explicitly reset the cache at the start of each request or job.
What happens if the qandidate/toggle backing store is unreachable?
The documented behaviour is not something to assume, so verify whether the repository throws an exception or defaults flags to inactive when Redis is unavailable. Decide fail-open or fail-closed per flag in your own wrapper rather than relying on the library default. Flags guarding payments or admin access usually need a deliberate, tested failure mode.
Can I use qandidate/toggle to guard entitlements or admin routes?
You can, but never evaluate those flags from client-controllable context. The condition model makes it easy to write user_id conditions that are only as trustworthy as the caller's input, so evaluate server-side using trusted identity and context. Treat flags gating paid features, admin routes or entitlements as security-sensitive configuration.
Is qandidate/toggle maintained, and what should I use instead?
Adoption is thin, with around 379 stars and no known dependents, and the stated 2026-08-09 release date should be checked against commit cadence and issue responsiveness. The MIT licence makes forking legal and feasible, but then maintenance becomes your code. If you need a managed platform, compare Unleash, LaunchDarkly or Flagsmith, and keep the exit cost low by depending on your own contract rather than the package directly.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect