switchover / laravel-integration
Laravel Integration for Switchover PHP SDK. Feature Toggle Management made easy.
Requires
- php: >=7.2
- laravel/framework: ~6.0|~7.0|~8.0
- switchover/php-sdk: ^0.5.4
Requires (Dev)
- orchestra/testbench: ^6.4
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2025-06-29 01:43:01 UTC
README
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