PHPackages                             humweb/features - 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. humweb/features

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

humweb/features
===============

Feature toggle package

14PHP

Since Jul 17Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Features Toggle
===============

[](#features-toggle)

[![Build Status](https://camo.githubusercontent.com/ffc9d7bacfe22b0e7d4324e7305c762d4ade110b030d707acfb91c22a687d221/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f68756d7765622f66656174757265732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/humweb/features)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ae169b5aeeefc4dd24f99bdf9b79d2529f93c0bfe11c63a8bcf310591da0b6f2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68756d7765622f66656174757265732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/humweb/features/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/cdccdd4fa96103b0a6bec929fa34c5ff3649fd8617d8ac7c9d8cd430d7ffcc1a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68756d7765622f66656174757265732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/humweb/features/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/93c14a38c1fdad57c0b3a00ae23be189651da394faaaee5247837b9b0b956472/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37323665323634322d363535332d343065312d386234662d3731663864393035643766392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/726e2642-6553-40e1-8b4f-71f8d905d7f9)[![Total Downloads](https://camo.githubusercontent.com/58127dd764bf0a1dac549f70e489bb6219ae59356154dbc5c1b5cf5db47ed717/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68756d7765622f66656174757265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/humweb/features)[![Latest Version on Packagist](https://camo.githubusercontent.com/d518b738e26302e7951cd70b4c08c9350f1c9741ad0a4b6e7bad36422d2c28de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68756d7765622f66656174757265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/humweb/features)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Feature Toggle allows developers to toggle on/off features in the system using one or multiple Strategies.

Install
-------

[](#install)

Via Composer

```
$ composer require humweb/features
```

Usage
-----

[](#usage)

#### DateTime Strategy

[](#datetime-strategy)

```
$features = new Features();

$features->create('test.feature', 'Example feature description')
    ->add('StrategyKeyString', 'DataTime', [
        'date'     => '2015-11-10',
        'operator' => '>'
    ])
    ->setThreshold(1);

if ($features->isEnabled('test.feature')) {
    // Do something special
}
```

#### DateTimeRange Strategy

[](#datetimerange-strategy)

```
$features = new Features();

$features->create('test.feature', 'Example feature description')
    ->add('StrategyKeyString', 'DataTimeRange', [
            'start'  =>'2100-11-10',
            'end'    => '2100-12-10',
            'strict' => false
    ])
    ->setThreshold(1);

if ($features->isEnabled('test.feature')) {
    // Do something special
}
```

#### DaysOfWeek mixed with DateTimeRange Strategy

[](#daysofweek-mixed-with-datetimerange-strategy)

```
$features = new Features();

$features->create('business.hours', 'Match days of week')
     ->add('DaysOpen', 'DaysOfWeek', [
         'days' => ['sat']
     ])
     ->add('StoreHours', 'DateTimeRange', [
         'start'  =>'9am',
         'end'    => '11pm',
         'strict' => true
     ])
     ->setThreshold(2);

if ($features->isEnabled('business.hours')) {
    // Do something special
}
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ryan Shofner (Maintainer)](https://github.com/ryun)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b536bae26e43306745d195a34b8dff510bc05419cdc3503f96c5cb3fd4e7239?d=identicon)[ryun](/maintainers/ryun)

---

Top Contributors

[![ryun](https://avatars.githubusercontent.com/u/227672?v=4)](https://github.com/ryun "ryun (56 commits)")

### Embed Badge

![Health badge](/badges/humweb-features/health.svg)

```
[![Health](https://phpackages.com/badges/humweb-features/health.svg)](https://phpackages.com/packages/humweb-features)
```

###  Alternatives

[spatie/laravel-personal-data-export

Create personal data downloads in a Laravel app

550543.8k8](/packages/spatie-laravel-personal-data-export)[kodicomponents/navigation

The KodiCMS Support package.

12232.6k10](/packages/kodicomponents-navigation)

PHPackages © 2026

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