Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Allows you to configure feature switches.

License

Notifications You must be signed in to change notification settings

ronaldvaneede/laravel-feature-switches

Repository files navigation

Feature switches in Laravel 4

Latest Stable Version Total Downloads Build Status

This package allows you to use feature switches in your code.

Installation

You can install this package trough Composer. Add this to your composer.json file:

"require": {
    // ...
    "ronaldvaneede/laravel-feature-switches": "dev-master"
}

Now run composer install or composer update to download it.

After that add the service provider to the providers array within the app/config/app.php file.

'providers' => array(
    // ...
    'Ronaldvaneede\Featureswitch\FeatureswitchServiceProvider',
)

That's it!

Using Feature switches

To use the feature switches you have to add this to the app/config/app.php file:

'features' => array(
    'feature-a' => array('enabled' => 'on'),
    'feature-b' => array('enabled' => 'off')
)

Then you can use Featureswitch::allow('feature-a') and Featureswitch::allow('feature-b') to check if the feature is available. The allow() method will return either true or false.

Wishes

In the end this should support a configuration like this:

// on / off / users -> user_list => 'a,b,c' / staff / 1%
'features' => array(
    'login' => array('enabled' => 'on'),
    'facebook' => array('enabled' => 'off'),
    'google+' => array('enabled' => '5%'),
    'twitter' => array('enabled' => 'users', 'user_list' => 'ronald,jaap,piet')
)

About

Allows you to configure feature switches.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages