PHPackages                             qandidate/toggle-api - 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. [API Development](/categories/api)
4. /
5. qandidate/toggle-api

ActiveLibrary[API Development](/categories/api)

qandidate/toggle-api
====================

Api interface for your toggles.

1.0.1(3y ago)311649[1 PRs](https://github.com/qandidate-labs/qandidate-toggle-api/pulls)MITPHPPHP &gt;=7.2

Since Aug 19Pushed 2y ago6 watchersCompare

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

READMEChangelog (2)Dependencies (14)Versions (7)Used By (0)

Toggle API
==========

[](#toggle-api)

An API for managing your toggles, uses Redis to store the toggle collection.

[![build status](https://github.com/qandidate-labs/qandidate-toggle-api/actions/workflows/ci.yml/badge.svg)](https://github.com/qandidate-labs/qandidate-toggle-api/actions/workflows/ci.yml/badge.svg)

About
-----

[](#about)

Read our blog post series about this repository at:

-
-

Installation
------------

[](#installation)

Install the dependencies with composer:

```
make dependencies

```

Configuration is determined based on environment variables. See the `.env.*` files. You can override the values in the file with environment values. The default configuration is mainly for local development.

The environment variable `TOGGLE__ALLOWED_ORIGINS` should be valid JSON. This is to allow arrays.

Running the tests
-----------------

[](#running-the-tests)

We use PHPUnit, so to run the tests simply run:

```
docker-compose up -d
make test

```

Running the app
---------------

[](#running-the-app)

With your favorite webserver (or with `php -S 127.0.0.1:1337 -t public` for local testing) point your document root to the `public` folder.

Endpoints
---------

[](#endpoints)

#### Retrieve the toggles

[](#retrieve-the-toggles)

`GET /toggles`

#### Create or update a toggle

[](#create-or-update-a-toggle)

`PUT /toggles/{name}`

Example request:

```
{
   "conditions" : [
      {
         "name" : "operator-condition",
         "operator" : {
            "name" : "less-than",
            "value" : "1337"
         },
         "key" : "user_id"
      }
   ],
   "name" : "foo",
   "status" : "conditionally-active",
   "originalName" : "foo"
}

```

NOTE: PUT doesn't remove the previous toggle if you rename it. So if you want to rename *foo* to *bar*, you would have to `PUT` *bar* and `DELETE` *foo*.

#### Delete a toggle

[](#delete-a-toggle)

`DELETE /toggles/{name}`

License
-------

[](#license)

MIT, see LICENSE.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~717 days

Total

5

Last Release

1420d ago

Major Versions

0.3.0 → 1.0.02020-03-30

PHP version history (2 changes)0.1.0PHP &gt;=5.3.2

1.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/78fcc60c1d576c1f19a4c03297931f879354efbb7e054318ffe391a2a2f0a274?d=identicon)[asm89](/maintainers/asm89)

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

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

![](https://www.gravatar.com/avatar/387cfcacd63a3599555e6e7ece12c3f224abd718e7b8425b09586d0502107b66?d=identicon)[fritsjanb](/maintainers/fritsjanb)

![](https://www.gravatar.com/avatar/8975ebed957752c13449a32c9e528a43e7fd219ecc0244018e64ed1ee2079e28?d=identicon)[E1379](/maintainers/E1379)

---

Top Contributors

[![othillo](https://avatars.githubusercontent.com/u/2786663?v=4)](https://github.com/othillo "othillo (30 commits)")[![asm89](https://avatars.githubusercontent.com/u/657357?v=4)](https://github.com/asm89 "asm89 (23 commits)")[![wjzijderveld](https://avatars.githubusercontent.com/u/450201?v=4)](https://github.com/wjzijderveld "wjzijderveld (7 commits)")[![symm](https://avatars.githubusercontent.com/u/69390?v=4)](https://github.com/symm "symm (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![fritsjanb](https://avatars.githubusercontent.com/u/1194777?v=4)](https://github.com/fritsjanb "fritsjanb (3 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (1 commits)")[![ebroekmeulen](https://avatars.githubusercontent.com/u/1893048?v=4)](https://github.com/ebroekmeulen "ebroekmeulen (1 commits)")[![baiiko](https://avatars.githubusercontent.com/u/3129221?v=4)](https://github.com/baiiko "baiiko (1 commits)")

---

Tags

apifeaturetriggertoggleswitchflipbitsflipping

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/qandidate-toggle-api/health.svg)

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

###  Alternatives

[sylius/sylius

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

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

Feature toggling for your PHP application.

3812.0M9](/packages/qandidate-toggle)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/sulu

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

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

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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