PHPackages                             roboticsexpert/feature-flag - 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. roboticsexpert/feature-flag

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

roboticsexpert/feature-flag
===========================

Easy way to add feature flag functionality to your laravel application

v1.0.3(4y ago)128.9k1MITPHP

Since Jan 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/roboticsexpert/feature-flag)[ Packagist](https://packagist.org/packages/roboticsexpert/feature-flag)[ RSS](/packages/roboticsexpert-feature-flag/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Feature Flag (Feature toggle)
=====================================

[](#laravel-feature-flag-feature-toggle)

bring feature flag functionality to your project simple as possible

if you want to know what feature flag is, check martin fowler topic about it:

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

[](#installation)

```
composer require roboticsexpert/feature-flag
```

after instaling composer package, if you use auto discovery for service providers, everything ok, but if you blocked that just add this line to `config/app.php` in `providers` section:

```
Roboticsexpert\FeatureFlag\FeatureFlagServiceProvider::class
```

after that you should run

```
php artisan migrate
```

Usage
-----

[](#usage)

you can use this project with 2 strategy,Facade or Dependency injection!

I suggest to you to use it with dependecy injection for IDE auto complete feature but use it as you prefer!

### Facade

[](#facade)

you can get feature flag service like this:

```
use Roboticsexpert\FeatureFlag\FeatureFlagFacade as FeatureFlag;

FeatureFlag::getTypes()
```

### Dependecy Injection

[](#dependecy-injection)

you can get feature flag service like this:

```
use Roboticsexpert\FeatureFlag\Services\FeatureFlagService;

$featureFlag=app(\Roboticsexpert\FeatureFlag\Services\FeatureFlagService::class); //or you can get this service from input of controller method

$featureFlag->getTypes();
```

Methods
-------

[](#methods)

### Create Feature flag

[](#create-feature-flag)

```
$featureFlagModel=$featureFlagService->createFeatureFlag('FEATURE_NAME');
dd($featureFlagModel->name);
```

### Change type of feature flag (Admin)

[](#change-type-of-feature-flag-admin)

```
//OPTIONS: DISABLED , PRIVATE , PUBLIC
$featureFlagModel=$featureFlagService->changeFeatureFlagType('FEATURE_NAME','DISABLED');
//or
$featureFlagModel=$featureFlagService->changeFeatureFlagType('FEATURE_NAME',\Roboticsexpert\FeatureFlag\Models\FeatureFlag::TYPE_DISABLED);
```

### Delete feature flag (Admin)

[](#delete-feature-flag-admin)

```
$featureFlagService->destroyFeatureFlag('FEATURE_1');
```

### Get all Feature flags (Admin)

[](#get-all-feature-flags-admin)

```
$featureFlags=$featureFlagService->getAllFeatureFlags();
```

### Attach / Detach a user to/from a feature flag

[](#attach--detach--a-user-tofrom-a-feature-flag)

```
$featureFlagService->attachUserToFeatureFlag(1,'FEATURE_1');

$featureFlagService->detachUserToFeatureFlag(1,'FEATURE_1');
```

### Get List of not active features for a user or public user

[](#get-list-of-not-active-features-for-a-user-or-public-user)

first of all is should explain why you should user disabled features intead of enabled features !

- when a feature became public for all users, we should to tell all clients that the feature is enable until clients be update, but old clients need to have that feature for ever!!!
- if you return enabled features, your list of features became large and large!

finally i prefred to implement disabled features and you should return this list to client !

```
//It will return array of names of features (string)
//No input for not logged in users
$featureFlagService->getDisabledFeatureFlagsName();

//User identifier for logged in users
$featureFlags=$featureFlagService->getDisabledFeatureFlagsName(1);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Total

3

Last Release

1622d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9366277?v=4)[Mahdi Youseftabar](/maintainers/roboticsexpert)[@roboticsexpert](https://github.com/roboticsexpert)

---

Top Contributors

[![roboticsexpert](https://avatars.githubusercontent.com/u/9366277?v=4)](https://github.com/roboticsexpert "roboticsexpert (8 commits)")

---

Tags

featurefeature-flagfeature-toggleflaglaravelphptoggle

### Embed Badge

![Health badge](/badges/roboticsexpert-feature-flag/health.svg)

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

###  Alternatives

[bluemmb/faker-picsum-photos-provider

picsum.photos provider for Faker

31244.2k2](/packages/bluemmb-faker-picsum-photos-provider)[fragkp/laravel-route-breadcrumb

7011.7k](/packages/fragkp-laravel-route-breadcrumb)[aw-studio/laravel-states

445.6k](/packages/aw-studio-laravel-states)

PHPackages © 2026

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