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

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

inmanturbo/features
===================

Pluggable feature system built on top of laravel/pennant

v0.06(9mo ago)152[6 PRs](https://github.com/inmanturbo/features/pulls)1MITPHPPHP ^8.3CI passing

Since Sep 11Pushed 4mo agoCompare

[ Source](https://github.com/inmanturbo/features)[ Packagist](https://packagist.org/packages/inmanturbo/features)[ RSS](/packages/inmanturbo-features/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (6)Versions (16)Used By (1)

Features Package
================

[](#features-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6d0cff5ee64186cbf2e515867151f819f8ec8e5351ba02931361d3f26a847a94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6d616e747572626f2f66656174757265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inmanturbo/features)[![Tests](https://camo.githubusercontent.com/3229480870589473a3610fb177e8242a23622366ec00b2224331637be5263fc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696e6d616e747572626f2f66656174757265732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/inmanturbo/features/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/aed53280d956ee6f1cd9985bda4117176b4394725c0bef0c2a8c1dc464e73750/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6d616e747572626f2f66656174757265732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/inmanturbo/features)[![License](https://camo.githubusercontent.com/65fa2726e9c27e78ce9b40f9227fe616518a48ba26d061a5c94d16e1bae269c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696e6d616e747572626f2f66656174757265732e7376673f7374796c653d666c61742d737175617265)](https://github.com/inmanturbo/features/blob/main/LICENSE)

A pluggable feature system built on top of [Laravel Pennant](https://github.com/laravel/pennant).

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

[](#installation)

Install the package via Composer:

```
composer require inmanturbo/features
```

The service provider will be automatically registered thanks to Laravel's package auto-discovery.

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

[](#configuration)

### Defined-Database Driver

[](#defined-database-driver)

This package uses a custom `defined-database` driver that only retrieves features that have been explicitly defined. This allows removing features without losing any data, fetures can be redefined later with their data still intact.

The published Pennant config sets this as the default driver:

```
'default' => env('PENNANT_DRIVER', 'defined-database'),
```

Usage
-----

[](#usage)

### Before Hooks

[](#before-hooks)

```
use Laravel\Pennant\Feature;

Feature::before('new-api', function (User $user) {
  if (Config::get('features.new-api.disabled')) {
      return $user->isInternalTeamMember();
  }
});
```

### Resetting Feature Defaults

[](#resetting-feature-defaults)

#### Using the Artisan Command

[](#using-the-artisan-command)

The package provides a convenient `feature:reset` Artisan command to reset features interactively or via command line options.

##### Interactive Mode

[](#interactive-mode)

Run the command without options for an interactive experience:

```
php artisan feature:reset
```

When features exist in your database, the command will:

1. **Auto-discover** available scopes and features from your database
2. **Present interactive menus** to select:
    - A specific scope or "\[All Scopes\]"
    - A specific feature or "\[All Features\]"
3. **Safely reset** only the selected combination

If no features exist in the database, it will immediately reset (no-op) without prompting.

##### Command Line Options

[](#command-line-options)

Skip the interactive prompts by providing explicit options:

```
# Reset all features for all scopes (when database is empty)
php artisan feature:reset

# Reset all features for a specific scope
php artisan feature:reset --scope="user:1"

# Reset a specific feature for all scopes
php artisan feature:reset --feature="new-dashboard"

# Reset a specific feature for a specific scope
php artisan feature:reset --scope="user:1" --feature="new-dashboard"

# Reset non-existent features (safe no-op)
php artisan feature:reset --scope="nonexistent" --feature="missing"
```

##### Use Cases

[](#use-cases)

The `feature:reset` command is useful for:

- **Development**: Quickly reset feature flags during testing
- **Debugging**: Remove problematic feature overrides to fall back to defaults
- **Data cleanup**: Clear old or unused feature flag data
- **User management**: Reset features for specific users or teams
- **Feature rollback**: Revert features to their default state after experiments

#### Using the FeatureRegistry Class

[](#using-the-featureregistry-class)

The `FeatureRegistry` class provides a `resetDefaults` method to remove feature flags from the database, allowing them to fall back to their default values:

```
use Inmanturbo\Features\FeatureRegistry;

// Reset all features for all scopes
FeatureRegistry::resetDefaults();

// Reset all features for a specific scope (user, team, etc.)
FeatureRegistry::resetDefaults(scope: $user);

// Reset a specific feature for all scopes
FeatureRegistry::resetDefaults(name: 'feature-name');

// Reset a specific feature for a specific scope
FeatureRegistry::resetDefaults(scope: $user, name: 'feature-name');
```

This is useful when you want to:

- Remove overridden feature values and revert to defaults
- Clean up test data
- Reset features during development

Credits
-------

[](#credits)

This package is built on top of [Laravel Pennant](https://github.com/laravel/pennant), Laravel's official feature flag package.

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance67

Regular maintenance activity

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Every ~2 days

Total

6

Last Release

285d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0261babef618b8fb3bfcea84376ed5e71e7169586eb8de63a6550c2e7ea653a6?d=identicon)[inmanturbo](/maintainers/inmanturbo)

---

Top Contributors

[![inmanturbo](https://avatars.githubusercontent.com/u/47095624?v=4)](https://github.com/inmanturbo "inmanturbo (38 commits)")

---

Tags

hackathonvibe-coding

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[log1x/acf-composer

Create fields, blocks, option pages, and widgets using ACF Builder and Sage 10

504836.4k18](/packages/log1x-acf-composer)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[nativephp/desktop

NativePHP for Desktop

39742.4k8](/packages/nativephp-desktop)

PHPackages © 2026

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