PHPackages                             kirschbaum/laravel-feature-toggle - 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. kirschbaum/laravel-feature-toggle

ActiveLibrary

kirschbaum/laravel-feature-toggle
=================================

Simple feature toggles for Laravel PHP and Javascript

9161PHP

Since Feb 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kirschbaum/laravel-feature-toggle)[ Packagist](https://packagist.org/packages/kirschbaum/laravel-feature-toggle)[ RSS](/packages/kirschbaum-laravel-feature-toggle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Feature Toggle
======================

[](#laravel-feature-toggle)

This package allows for easy and efficient feature flag managment in Laravel. Features include:

- Definition of feature toggles per environment (e.g. local, dev, stage, production).
- Managable way to keep flags in source control without becomming overwhelming.
- Creation of a default setting per feature that will be used if the environment specific setting is not found.
- Ability to easily request the status of a feature and automatically get the correct setting based on the current environment the application is running on.
- Ability to tag features as eligable for Javascript export.
- A helper method to easily export Javascript eligable feature flags and pass them along to your front-end framework.

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

[](#installation)

Add the package to your project:

```
composer require kirschbaum/laravel-feature-flag

```

Add the following service provider:

```
// config/app.php

'providers' => [
    ...
    Kirschbaum\LaravelFeatureFlag\ServiceProvider::class,
    ...
];
```

This package also comes with a facade, making it easy to retrieve the correct flags for the environment you are in:

```
// config/app.php

'aliases' => [
    ...
    'FeatureFlag' => Kirschbaum\LaravelFeatureFlag\Facades\FeatureFlag::class,
    ...
]
```

Publish the config file using the arisan command:

```
php artisan vendor:publish --provider="Kirschbaum\LaravelFeatureFlag\ServiceProvider"

```

The configuration looks like this:

```
