soapbox/laravel-rollout
Composer 安装命令:
composer require soapbox/laravel-rollout
包简介
A package to integrate rollout into your Laravel project.
README 文档
README
A Laravel package for opensoft/rollout
Installation
Composer
composer require jaspaul/laravel-rollout
Configuring the Service Provider
Package discovery will configure the service provider automatically.
Setting up Storage
Publish the Configuration
php artisan vendor:publish --provider 'Jaspaul\LaravelRollout\ServiceProvider'
Setting up a Cache
If you intend to use cache to store the settings for rollout, be sure to enable the cache for your Laravel application. Note if you are using the cache, a cache clear during deployment will cause your rollout settings to be purged. If you require persistence for these settings use the option below.
Setting up Persistent Storage
This will allow you to have rollout settings be persisted even if you clear the application cache for every deployment.
Running the Migrations
php artisan migrate
Configuring your Environment
ROLLOUT_STORAGE=database
ROLLOUT_TABLE=rollout
Implementing Interfaces
User
Your rollout users must implement the \Jaspaul\LaravelRollout\Contracts\User interface. Often this will be your main user object:
<?php use Jaspaul\LaravelRollout\Helpers\User as Contract; class User implements Contract { /** * @return string */ public function getRolloutIdentifier() { return $this->id; } }
Group
Your rollout groups must implement the \Jaspaul\LaravelRollout\Contracts\Group interface.
<?php use Jaspaul\LaravelRollout\Contracts\Group; class BetaUsersGroup implements Group { /** * The name of the group. * * @return string */ public function getName(): string { return 'beta-users'; } /** * Defines the rule membership in the group. * * @return boolean */ public function hasMember($user = null): bool { if (!is_null($user)) { return $user->hasOptedIntoBeta(); } return false; } }
and you should update your local laravel-rollout.php configuration to include the group in the groups array:
laravel-rollout.php
return [ ... 'groups' => [ BetaUsersGroup::class ], ... ]
Commands
Add Group
php artisan rollout:add-group {feature} {group}
Swap {feature} with the name of the feature, and {group} with the name you defined in the group class.
Add User
php artisan rollout:add-user {feature} {user}
Swap {feature} with the name of the feature, and {user} with a unique identifier for the user in your system.
Create
php artisan rollout:create {feature}
Swap {feature} with the name of the feature you'd like to create a feature flag for.
Deactivate
php artisan rollout:deactivate {feature}
Swap {feature} with the name of the feature you'd like to deactivate globally. Note this will also reset the user allowlist.
Delete
php artisan rollout:delete {feature}
Swap {feature} with the name of the feature you'd like to permanently delete from rollout.
Everyone
php artisan rollout:everyone {feature}
Swap {feature} with the name of the feature you'd like to rollout to 100% of your user base.
List
php artisan rollout:list
Percentage
php artisan rollout:percentage {feature} {percentage}
Swap {feature} with the name of the feature you'd like to rollout, and {percentage} with the percentage of users to rollout the feature to.
Remove Group
php artisan rollout:remove-group {feature} {group}
Swap {feature} with the name of the feature, and {group} with the name you defined in the group class.
Remove User
php artisan rollout:remove-user {feature} {user}
Swap {feature} with the name of the feature, and {user} with a unique identifier for the user in your system to remove the feature from.
soapbox/laravel-rollout 适用场景与选型建议
soapbox/laravel-rollout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19.48k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「rollout」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 soapbox/laravel-rollout 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 soapbox/laravel-rollout 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 soapbox/laravel-rollout 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A package to integrate rollout into your Laravel project.
PHP SDK for Floodgate, a cloud service which provides a centralized management console for managing remote feature flags.
Symfony integration with Rollout Rox library
laravel-rollout updated to support Laravel 9
Provides a feature flag mechanism (Symfony 4.4 / PHP 7.4 backport)
Alfabank REST API integration
统计信息
- 总下载量: 19.48k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-05
