PHPackages                             landingi/toggle-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. landingi/toggle-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

landingi/toggle-bundle
======================

Bundle with core functionality that gives a hand to check features for a given account

v1.0.0(5y ago)010.4k↓33.3%[1 issues](https://github.com/landingi/toggle-bundle/issues)MITPHPPHP &gt;=7.4

Since Apr 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/landingi/toggle-bundle)[ Packagist](https://packagist.org/packages/landingi/toggle-bundle)[ RSS](/packages/landingi-toggle-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/728b908a402ac22027b210a4c5a420d4f9b74784784e79b1f468ffd9be15a0a1/68747470733a2f2f7472617669732d63692e636f6d2f6c616e64696e67692f746f67676c652d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/landingi/toggle-bundle)

Toggle bundle
=============

[](#toggle-bundle)

Feature Flag
============

[](#feature-flag)

System for checking whether account has feature flag enabled.

FeatureFlagsSource
------------------

[](#featureflagssource)

### implementations:

[](#implementations)

- `Landingi\ToggleBundle\FeatureFlagsSource\DbSource` - should use Landingi Read Only DB instance to fetch features from `accounts_features` table by account's UUID and from `packages_features` table by account's package.
- `Landingi\ToggleBundle\FeatureFlagsSource\RedisSource` - fetches feature flags list cached in Redis by account's UUID as a key.
- `Landingi\ToggleBundle\FeatureFlagsSource\CachingSource` - this class is an abstraction for caching feature flags list for account.

Configuration
-------------

[](#configuration)

The bundle provides a configuration that allows you to easily control the data access layer. Configuration file should be created at a path: `config/packages/landingi_toggle.yaml`.

```
landingi_toggle:
    dbal:
        connection_name: mysql # DBAL connection name (this should be a read only connection, for a better performance)
    cache:
        enabled: true # If enabled then CachingSource is used, otherwise DbSource is used to fetch the feature flags
        redis_connection:
            schema: 'tcp'
            host: '%env(REDIS_HOST)%'
            port: 6379
        ttl: 60 # Time to live for cached feature flags entries for a selected account_uuid
```

Usage
-----

[](#usage)

To check feature flag access for a selected account\_uuid follow below code snippet:

```
use Landingi\ToggleBundle\AccessVoter;

class ExampleService
{
    private AccessVoter $accessVoter;

    public function __construct(AccessVoter $accessVoter)
    {
        $this->accessVoter = $accessVoter;
    }

    public function exampleMethod(string $accountUuid)
    {
        /** ... some logic  */

        if ($this->accessVoter->vote($accountUuid, 'EXAMPLE_FEATURE_FLAG')) {
            // Access granted
        }
    }
}
```

`AccessVoter` is already defined in the symfony dependency injection container, so we can easily use it as a dependency in every service class in the whole project.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1873d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/859d0bbd1ef0d0772cf6c515be1510752ba68743d03e84435ee7b2e6117a08f2?d=identicon)[Ferror](/maintainers/Ferror)

![](https://www.gravatar.com/avatar/ad7e3714f206fe283305d9a48fe8bcf4d650b34e5649a67737c5e99801fdcf68?d=identicon)[devofdisaster](/maintainers/devofdisaster)

---

Top Contributors

[![Ferror](https://avatars.githubusercontent.com/u/17534504?v=4)](https://github.com/Ferror "Ferror (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/landingi-toggle-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/landingi-toggle-bundle/health.svg)](https://phpackages.com/packages/landingi-toggle-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
