PHPackages                             ez-php/feature-flags - 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. [Framework](/categories/framework)
4. /
5. ez-php/feature-flags

ActiveLibrary[Framework](/categories/framework)

ez-php/feature-flags
====================

Simple feature flag evaluation for the ez-php framework — File, Database, and Array drivers with a static Flag facade

1.2.0(1mo ago)00MITPHPPHP ^8.5CI passing

Since Mar 28Pushed 1mo agoCompare

[ Source](https://github.com/ez-php/feature-flags)[ Packagist](https://packagist.org/packages/ez-php/feature-flags)[ Docs](https://github.com/ez-php/feature-flags)[ RSS](/packages/ez-php-feature-flags/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (5)Used By (0)

ez-php/feature-flags
====================

[](#ez-phpfeature-flags)

Simple feature flag evaluation for the ez-php framework. No external service required — flags are stored in a PHP file, a database table, or a plain array.

---

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

[](#installation)

```
composer require ez-php/feature-flags
```

Register the provider in `provider/modules.php`:

```
\EzPhp\FeatureFlags\FeatureFlagServiceProvider::class,
```

---

Usage
-----

[](#usage)

```
use EzPhp\FeatureFlags\Flag;

if (Flag::enabled('new-checkout')) {
    // show new checkout flow
}

if (Flag::disabled('dark-mode')) {
    // show light theme
}

$all = Flag::all(); // ['new-checkout' => true, 'dark-mode' => false]
```

---

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

[](#configuration)

Add a `config/flags.php` to your application:

```
return [
    'flags' => [
        'driver' => env('FLAGS_DRIVER', 'file'),  // file | database | array
        'file'   => base_path('config/flags.php'),
    ],
];
```

### Drivers

[](#drivers)

DriverConfig key valueDescription`file``file`Reads a PHP file returning `array``database``database`Reads a `feature_flags` table via PDO`array``array`Empty in-memory driver (CI / test environments)### File driver

[](#file-driver)

Create `config/flags.php` in your application:

```
