Coder Social home page Coder Social logo

feature-flags's Introduction

Laravel Feature Flags ๐Ÿš€

GitHub Actions GitHub commits since latest release (by SemVer) Latest Version on Packagist Total Downloads Packagist PHP Version Support codecov

A Feature flag is at times referred to as a feature toggle or feature switch. Ultimately it's a coding strategy to be used along with source control to make it easier to continuously integrate and deploy. The idea of the flags works by essentially safe guarding sections of code from executing if a feature flag isn't in a switched on state.

This package aims to make implementing such flags across your application a great deal easier by providing solutions that work with not only your code but your routes, blade files, task scheduling and validations.

Installation

You can install the package via composer:

composer require mwkcoding/feature-flags

Publish the config:

php artisan vendor:publish --provider="Mwk\FeatureFlags\FeatureFlagsServiceProvider" --tag="config"

Usage

In your controllers, jobs, etc.

// Check if a feature is enabled in your backend logic
use Mwk\FeatureFlags\FeatureManagerFacade;

if (FeatureManagerFacade::feature('my-feature')->enabled()) {
    // Your feature specific logic
}

Blade views

@feature('my-feature')
    <p>Feature turned on</p>
@endfeature

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

feature-flags's People

Contributors

mwkcoding avatar

Watchers

 avatar

feature-flags's Issues

[Feature Request] Allow specific users to bypass flag state

As the title says; Allowing specific users to bypass the state of one or more feature flags.

This'd allow developers to ensure proper functionality even on their live site by bypassing the off state, and seeing the flagged code regardless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.