wework / unleash-wrapper
A Laravel wrapper for Unleash, facilitating feature flag management.
Requires
- php: >=7.4
- guzzlehttp/guzzle: >=6.0.0
- laravel/framework: >=8.4
- symfony/cache: *
- unleash/client: *
Requires (Dev)
- fakerphp/faker: ^1.9.1
- laravel/pint: ^1.0
- laravel/sail: ^1.18
- mockery/mockery: ^1.4.4
- nunomaduro/collision: ^7.0
- phpunit/phpunit: ^10.1
- spatie/laravel-ignition: ^2.0
This package is auto-updated.
Last update: 2025-03-20 10:54:11 UTC
README
This Laravel package provides an easy-to-use integration with Unleash, enabling feature flag management directly within your Laravel applications. Leverage the power of feature toggles to deliver new functionality more safely and with better control.
Features
- Simple Laravel integration with Unleash
- Environment-specific feature flag management
- Custom context support for advanced feature toggling
Requirements
- PHP >= 7.4
- Laravel >= 8.4
Installation
Step 1: Composer
You can install the package via composer:
composer require wework/unleash-wrapper:dev-main
Step 2: Publish Configuration
Publish the package configuration file to your Laravel project:
php artisan vendor:publish --tag="unleash-config"
Step 3: Environment Configuration
Add the necessary environment variables to your .env
file:
UNLEASH_URL=https://your-unleash-server.com UNLEASH_PROJECT_NAME=yourProjectName UNLEASH_INSTANCE_ID=yourInstanceId UNLEASH_API_KEY=yourSecretApiKey
Usage
use Wework\UnleashWrapper\Facades\Unleash; if (Unleash::isEnabled('your-feature-flag')) { #The feature is enabled } else { #The feature is not enabled }
Advanced Usage
Refer to the Unleash documentation for more advanced features like dynamic context fields, strategy constraints, and more.
License
The Unleash Wrapper for Laravel is open-sourced software licensed under the MIT license.
Support
If you encounter any problems or have any suggestions, please open an issue on our GitHub repository.