taskord / unleash
Laravel 的 Unleash 客户端
这个包的官方仓库似乎已不存在,因此该包已被冻结。
0.0.6
2020-10-03 15:14 UTC
Requires
- guzzlehttp/guzzle: ^7.0
- illuminate/http: ^5.8|^6|^7|^8
- illuminate/support: ^5.8|^6|^7|^8
Requires (Dev)
- phpunit/phpunit: ^9.2
- squizlabs/php_codesniffer: ^3.5
README
Fork自 https://github.com/mikefrancis/laravel-unleash
Laravel 的 Unleash 客户端。
安装
composer require taskord/unleash
导出包配置
php artisan vendor:publish --provider="Taskord\LaravelUnleash\ServiceProvider"
配置
配置文档可以在 config/unleash.php 中找到。
使用
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 指令
@featureEnabled('myAwesomeFeature')
Congratulations, you can see this awesome feature!
@endfeatureEnabled
或者如果功能是 禁用
@featureDisabled('myAwesomeFeature')
Check back later for more features!
@endfeatureDisabled