PHPackages                             evolabs/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. evolabs/laravel-feature-flags

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

evolabs/laravel-feature-flags
=============================

Add simple database feature flags

1.0.4(3y ago)034MITPHPPHP ^8.1

Since Oct 20Pushed 3y agoCompare

[ Source](https://github.com/evostudio-pl/laravel-feature-flags)[ Packagist](https://packagist.org/packages/evolabs/laravel-feature-flags)[ RSS](/packages/evolabs-laravel-feature-flags/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

What it does
------------

[](#what-it-does)

This package allows you to add flags in your application and thus easily turn on/off its features.

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

[](#installation)

You can install the package via composer:

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

The package will automatically register its service provider.

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Evolabs\FeatureFlags\FeatureFlagsServiceProvider" --tag=migrations
php artisan migrate
```

You can publish and customize config file with:

```
php artisan vendor:publish --provider="Evolabs\FeatureFlags\FeatureFlagsServiceProvider" --tag=config
```

Usage
-----

[](#usage)

Features are storing in database. To use them in your application you should first create them e.g. via database seeder class:

```
use Evolabs\FeatureFlags\Models\Feature;
use Illuminate\Database\Seeder;

class FeaturesTableSeeder extends Seeder
{
    public function run()
    {
        Feature::query()->create(['name' => 'information_pages'];
        Feature::query()->create(['name' => 'locale_change', 'group' => 'admin'];
    }
}
```

All public methods are available via the facade class `Evolabs\FeatureFlags\Facades\Facades`.

Check feature is accessible
---------------------------

[](#check-feature-is-accessible)

```
Features::isAccessible('information_pages')
```

Add middleware to ensure that feature is enabled
------------------------------------------------

[](#add-middleware-to-ensure-that-feature-is-enabled)

```
Route::get('/', 'YourController@index')->middleware('feature:information_pages')
```

Toggle features with artisan commands
-------------------------------------

[](#toggle-features-with-artisan-commands)

```
php artisan feature:on information_pages

php artisan feature:off information_pages
```

List all features
-----------------

[](#list-all-features)

```
Features::all()
```

It will returns a collection of `FeatureData` objects:

```
namespace Evolabs\FeatureFlags\DataTransferObjects;

class FeatureData
{
    public function __construct(
        public readonly string $name,
        public readonly ?string $group,
        public readonly bool $is_enabled
    ) {
    }
}
```

Create feature groups e.g. for back office or frontend area
-----------------------------------------------------------

[](#create-feature-groups-eg-for-back-office-or-frontend-area)

```
Feature::query()->create(['name' => 'information_pages', 'group' => 'admin'];
Feature::query()->create(['name' => 'media_library', 'group' => 'admin'];
```

You can then load all the features in group:

```
Features::all('admin')
```

Use feature flags in blade views
--------------------------------

[](#use-feature-flags-in-blade-views)

```
@feature('information_pages')
    Feature flag `information_pages` is turned on.
@endfeature
```

Use feature flags with Inertia and vue
--------------------------------------

[](#use-feature-flags-with-inertia-and-vue)

You can load feature flags in `HandleInertiaRequests` middleware class:

```
use Evolabs\FeatureFlags\Facades\Features;
use Illuminate\Http\Request;
use Inertia\Middleware;

class HandleInertiaRequests extends Middleware
{
    /**
     * The root template that's loaded on the first page visit.
     *
     * @see https://inertiajs.com/server-side-setup#root-template
     *
     * @var string
     */
    protected $rootView = 'admin/app';

    /**
     * Defines the props that are shared by default.
     *
     * @see https://inertiajs.com/shared-data
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function share(Request $request)
    {
        return [
            ...parent::share($request),
            'features' => Features::all('admin')->pluck('is_enabled', 'name')
        ];
    }
}
```

and use them in your vue template:

```

    Feature flag `information_pages` is turned on.

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Total

4

Last Release

1247d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dbcf282f742ebd0a822476f21f7ddb3aac459e098fd33dc11442e3cf678a8a5?d=identicon)[evostudio](/maintainers/evostudio)

---

Top Contributors

[![herrlein-dawid](https://avatars.githubusercontent.com/u/72010889?v=4)](https://github.com/herrlein-dawid "herrlein-dawid (11 commits)")

---

Tags

feature-flagslaravel-feature-flagsevostudioevolabs

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[zonneplan/laravel-module-loader

Module loader for Laravel

24118.4k](/packages/zonneplan-laravel-module-loader)[spatie/laravel-morph-map-generator

Automatically generate morph maps in your Laravel application

73464.9k1](/packages/spatie-laravel-morph-map-generator)

PHPackages © 2026

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