PHPackages                             thisismahabadi/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. thisismahabadi/laravel-feature-flags

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

thisismahabadi/laravel-feature-flags
====================================

This package helps you implement feature flags in your Laravel application without a 3rd party service.

1.0.8(3y ago)320MITPHP

Since Sep 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/thisismahabadi/laravel-feature-flags)[ Packagist](https://packagist.org/packages/thisismahabadi/laravel-feature-flags)[ RSS](/packages/thisismahabadi-laravel-feature-flags/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (10)Used By (0)

Laravel feature flags
=====================

[](#laravel-feature-flags)

This package helps you implement feature flags in your Laravel application without a 3rd party service.

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

[](#installation)

```
composer require thisismahabadi/laravel-feature-flags
```

How does it work?
-----------------

[](#how-does-it-work)

So it's simply using two database tables and trait `(src/Traits/FeatureFlag.php)` to check if the accessor (user, team, agency, etc.) has access to the requested resource or not.

Tables are:

**feature\_flags** (to store the feature itself including its name and the date which determines the availability date.)

**feature\_flag\_permissions** (that stores which accessors \[or whatever you specify\] have access to what features)

After having the information in the database, all you need to do is to use the mentioned trait in any classes you want, for example, there is also a Middleware `(src/Http/Middleware/CheckFeatureFlagAccess.php)` which is using that trait, and you can also use it to secure your routes. To assign middleware to routes, do something like this:

`Route::middleware('feature_flag:whatsapp')->post('api/v1/whatsapp', WhatsAppController@sendMessage);`

The logic of the feature flag trait is that firstly it checks the **feature\_flags** table that if the feature is valid and if so, it'll then check the **feature\_flag\_permissions** table to see if the accessor which is requesting has a correlated record in the database.

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

[](#configuration)

If you execute Laravel's `vendor:publish` command, your file will be copied to the specified publish location, and then the configurations can be customized.

```
php artisan vendor:publish --tag=feature-flags-config
```

Code requirements
-----------------

[](#code-requirements)

This part is **only** being used if you want the **Middleware** of this package.

By default, this package is using `featureAccessor()` **belongsTo** relation in the User's model as an accessor resource, and if that relation can not be found it will use the user\_id who requests an endpoint.

But, Did you know you can also use another resource that you use in your company? Such as `team_id`, `agency_id`, `customer_id` or whatever you use.

Example for using `agency_id`:

```
public function featureAccessor(): BelongsTo
{
    return $this->belongsTo(Agency::class, 'agency_id', 'id');
}
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

9

Last Release

1387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db3ac77ab0bacef9a96c592f24b1414f913ae2adea64ec806846c58102228e08?d=identicon)[thisismahabadi](/maintainers/thisismahabadi)

---

Top Contributors

[![thisismahabadi](https://avatars.githubusercontent.com/u/32453263?v=4)](https://github.com/thisismahabadi "thisismahabadi (17 commits)")

---

Tags

laravelphplaravel

### Embed Badge

![Health badge](/badges/thisismahabadi-laravel-feature-flags/health.svg)

```
[![Health](https://phpackages.com/badges/thisismahabadi-laravel-feature-flags/health.svg)](https://phpackages.com/packages/thisismahabadi-laravel-feature-flags)
```

###  Alternatives

[stephenjude/filament-blog

Filament Blog Builder

20518.8k](/packages/stephenjude-filament-blog)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11258.1k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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