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

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

collab-corp/laravel-feature-toggle
==================================

Config driven feature toggle for Laravel.

265133PHPCI failing

Since Feb 9Pushed 6y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

Laravel 5 Feature toggle
========================

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

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
    - [Binding callbacks](#binding_callbacks)
- [Usage](#usage)
    - [JavaScript](#javascript)
- [Testing](#testing)
- [Events](#events)
- [Issues](#issues)
- [License](#license)

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

[](#installation)

For Laravel ~5
--------------

[](#for-laravel-5)

```
composer require collab-corp/laravel-feature-toggle

```

As with any package, it's a good idea to refresh composer autoloader.

```
composer dump-autoload
```

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

[](#configuration)

To publish `features.php` config file, run the following, `vendor:publish` command.

```
php artisan vendor:publish --provider="\CollabCorp\LaravelFeatureToggle\FeatureToggleServiceProvider"
```

You may then configure your config to your liking, it is possible to use callbacks or callables strings as values.

### Binding callbacks

[](#binding-callbacks)

It can become quite cumbersome with a lot of callbacks in your features config, binding a callback to an alias makes this a breeze.

```
Feature::bind('evaluation', function ($user, ...$dependencies) {
	// logic.

	return (boolean) $result;
});
```

In addition to letting laravel inject dependencies through the container, it is also possible to specify values in a comma seperated list.

In your config...

```
// config/features.php
