PHPackages                             rescaled/simple-feature - 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. rescaled/simple-feature

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

rescaled/simple-feature
=======================

This package aims to provide a fully-featured, yet simple feature flag configuration through environment variables for Laravel 7+

1.0.2(4y ago)2328[2 PRs](https://github.com/rescaled/simple-feature/pulls)MITPHPPHP ^8.0CI passing

Since Jan 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rescaled/simple-feature)[ Packagist](https://packagist.org/packages/rescaled/simple-feature)[ Docs](https://github.com/rescaled/simple-feature)[ GitHub Sponsors](https://github.com/rescaled)[ RSS](/packages/rescaled-simple-feature/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (11)Versions (6)Used By (0)

Simple Feature
==============

[](#simple-feature)

[![Latest Version on Packagist](https://camo.githubusercontent.com/89b46bec3f2d7b4254dee75ca0a8922c9fe0b17a3b98806867b784711ace2155/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657363616c65642f73696d706c652d666561747572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rescaled/simple-feature)[![GitHub Tests Action Status](https://camo.githubusercontent.com/edb9084d344fb891e5e7162941904ed64f69b719094f3dba01d041f49eef7242/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f72657363616c65642f73696d706c652d666561747572652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/rescaled/simple-feature/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/458ee7e24c2312963fdd9dab4b6ffd386cd46df4be2ce3af26c66e529333584d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f72657363616c65642f73696d706c652d666561747572652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/rescaled/simple-feature/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1be1e6811bae2a35d5a49959e6b75cc2e758d43e9c91f8b36a5f7c4e81c7b1b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72657363616c65642f73696d706c652d666561747572652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rescaled/simple-feature)

Simple Feature allows you to define feature flags via environment variables and check for their state within your Laravel application. It also provides pre-defined middleware you can utilize for this use case.

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

[](#installation)

You can install the package via composer:

```
composer require rescaled/simple-feature
```

Usage
-----

[](#usage)

### Define feature flags

[](#define-feature-flags)

Feature flags are defined in your environment file. They must be defined in snake case as well as being prefixed with `FEATURE_`.

```
FEATURE_FIRST_TEST=true
FEATURE_SECOND_TEST=true

FEATURE_THIRD_TEST=false
FEATURE_FOURTH_TEST=false
```

### Direct usage

[](#direct-usage)

You can directly access the package's methods as following.

```
SimpleFeature::enabled('firstTest') // true
SimpleFeature::disabled('firstTest') // false
SimpleFeature::allEnabled(['firstTest', 'secondTest']) // true
SimpleFeature::allDisabled(['thirdTest', 'fourthTest']) // true
SimpleFeature::allEnabled(['firstTest', 'thirdTest']) // false
SimpleFeature::allDisabled(['firstTest', 'thirdTest']) // false
```

### Middleware

[](#middleware)

The package comes with two middlewares that allow to check whether a given set of features is enabled or disabled.

```
// FEATURE_REGISTRATION=true
// FEATURE_ON_PREMISE=true

Route::get('/register', [RegistrationController::class, 'create'])->middleware('feature.enabled:registration');
Route::get('/billing', [BillingController, 'show'])->middleware('feature.disabled:onPremise');
```

If the feature hasn't the desired state the middleware will abort the request with a 404.

### Blade

[](#blade)

Furthermore, you can use conditional Blade directives to render content based on the state of a given feature flag.

```
@feature('registration')
    Register
@endfeature
```

```
@unlessfeature('onPremise')
...
@endunlessfeature
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Tobias Hannaske](https://github.com/thannaske)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~10 days

Total

3

Last Release

1605d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8004696?v=4)[Tobias](/maintainers/thannaske)[@thannaske](https://github.com/thannaske)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![thannaske](https://avatars.githubusercontent.com/u/8004696?v=4)](https://github.com/thannaske "thannaske (14 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")

---

Tags

featurefeature-flagsfeature-toggleslaravellaravelrescaledsimple-feature

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/rescaled-simple-feature/health.svg)

```
[![Health](https://phpackages.com/badges/rescaled-simple-feature/health.svg)](https://phpackages.com/packages/rescaled-simple-feature)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

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