taskord/unleash

An Unleash client for Laravel

This package's canonical repository appears to be gone and the package has been frozen as a result.

0.0.6 2020-10-03 15:14 UTC

This package is auto-updated.

Last update: 2024-08-29 05:43:33 UTC


README

Fork of https://github.com/mikefrancis/laravel-unleash

An Unleash client for Laravel.

Installation

composer require taskord/unleash

Export package config:

php artisan vendor:publish --provider="Taskord\LaravelUnleash\ServiceProvider"

Configuration

Documentation for configuration can be found in config/unleash.php.

Usage


use \Taskord\LaravelUnleash\Unleash;

$unleash = app(Unleash::class);

if ($unleash->isFeatureEnabled('myAwesomeFeature')) {
  // Congratulations, you can see this awesome feature!
}

if ($unleash->isFeatureDisabled('myAwesomeFeature')) {
  // Check back later for more features!
}

$allFeatures = $unleash->getFeatures();

Blade

Blade directive for checking if a feature is enabled:

@featureEnabled('myAwesomeFeature')
Congratulations, you can see this awesome feature!
@endfeatureEnabled

Or if a feature is disabled:

@featureDisabled('myAwesomeFeature')
Check back later for more features!
@endfeatureDisabled