All Projects → Jaspaul → laravel-rollout

Jaspaul / laravel-rollout

Licence: other
A package to integrate rollout into your Laravel project.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-rollout

toggler
toggler is a feature flag service to decouple deployment, feature enrollment and experiments
Stars: ✭ 27 (+17.39%)
Mutual labels:  feature-flags, feature-toggles, rollout, feature-toggle
Flipper
🐬 Beautiful, performant feature flags for Ruby.
Stars: ✭ 2,732 (+11778.26%)
Mutual labels:  feature-flags, feature-toggles, rollout, feature-toggle
flipper
Feature Flipper, Feature Flags, Rollout Flags, Feature Toggles for Crystal
Stars: ✭ 21 (-8.7%)
Mutual labels:  feature-flags, feature-toggles, rollout
PowerShell-FeatureFlags
PowerShell module containing a Feature Flags implementation based on a local config file.
Stars: ✭ 15 (-34.78%)
Mutual labels:  feature-flags, feature-toggles, rollout
doorkeeper
A Feature Toggle for PHP
Stars: ✭ 16 (-30.43%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
php-client
PHP SDK client for Split Software
Stars: ✭ 14 (-39.13%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
js-sdk
JavaScript frontend SDK for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
Stars: ✭ 21 (-8.7%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
ld-scheduler
Schedule Launch Darkly flags on or off
Stars: ✭ 14 (-39.13%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
ruby-client
Ruby SDK client for Split Software
Stars: ✭ 22 (-4.35%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
featurehub
FeatureHub - cloud native feature flags, A/B testing and remote configuration service. Real-time streaming feature updates. Provided with Java, JavaScript, Go, .Net, Android and Flutter SDKs.
Stars: ✭ 136 (+491.3%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
ld-redux
A library to integrate launch darkly with react redux
Stars: ✭ 33 (+43.48%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
flagsmith-js-client
Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 42 (+82.61%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
Unleash
Unleash is the open source feature toggle service.
Stars: ✭ 4,679 (+20243.48%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
eight ball
Ruby gem for querying feature flags
Stars: ✭ 17 (-26.09%)
Mutual labels:  feature-flags, feature-toggles, feature-toggle
unleash-docker
Docker container for unleash
Stars: ✭ 89 (+286.96%)
Mutual labels:  feature-flags, feature-toggles
java-server-sdk
LaunchDarkly Server-Side SDK for Java
Stars: ✭ 71 (+208.7%)
Mutual labels:  feature-flags, feature-toggles
flagsmith-java-client
Java Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 16 (-30.43%)
Mutual labels:  feature-flags, feature-toggles
java-client
Java SDK client for Split Software
Stars: ✭ 20 (-13.04%)
Mutual labels:  feature-flags, feature-toggles
php-server-sdk
LaunchDarkly Server-side SDK for PHP
Stars: ✭ 31 (+34.78%)
Mutual labels:  feature-flags, feature-toggles
js-client-sdk
LaunchDarkly Client-side SDK for Browser JavaScript
Stars: ✭ 93 (+304.35%)
Mutual labels:  feature-flags, feature-toggles

Laravel Rollout

A Laravel package for opensoft/rollout

Build Status Coverage Status Code Climate

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 whitelist.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].