LaravelPackages.net
Acme Inc.
Toggle sidebar
switchover/laravel-integration

Laravel Integration for Switchover PHP SDK. Feature Toggle Management made easy.

278
6
0.5.4
About switchover/laravel-integration

switchover/laravel-integration is a Laravel package for laravel integration for switchover php sdk. feature toggle management made easy.. It currently has 6 GitHub stars and 278 downloads on Packagist (latest version 0.5.4). Install it with composer require switchover/laravel-integration. Discover more Laravel packages by switchover or browse all Laravel packages to compare alternatives.

Last updated

Switchover Laravel Integration

CI codecov

Switchover

Switchover is a Software-As-A-Service for managing feature toggles (aka switches, flags or feature flips) in your application. Use it for Continous Integration, Continous Delivery, A/B-Testing, Canary Releases, Experementing and everything else you can think of.

Note: Laravel integration of the Switchover PHP SDK.

Getting Started

Install

Via composer:

composer require switchover/laravel-integration

Configuration

The SDK-Key (can be found on the switchover environment page) can be specified as env variable in your .env file:

SWITCHOVER_SDK_KEY=<YOUR SDK KEY>

If you want to change the default cache time of 60 seconds you can also modify this via env variable:

SWITCHOVER_CACHE_TIME=10 # Warning: 0 will cache forever

Basic Usage

The package exposes the Switchover facade to handle your feature toggles in the application.

Example:

class HomeController extends Controller
{

    public function index() {

        $userCtx = new Context([
            'email' => Auth::user()->email;
        ])
        
        $coolNewFeatures = Switchover::toggleValue('cool-feature', false, $userCtx);

        return //...
    }
}

Advanced Configuration

You can also publish the underlying config file to get full control over the config e.g. for the Guzzle Http client:

php artisan vendor:publish --tag="switchover-config"

Now, you should have the switchover.config in your app config folder.

Documentation

Learn more on the official documentation: Switchover Quickstart

Star History Chart