The SitePoint PHP blog has posted a tutorial showing you how to use the Toggle library from Qandidate to handle the enabling and disabling of features in your application.
A frequently used development workflow in version control systems is feature branching. The idea is that we develop new features in branches other than the master one. After a feature is tested and ready to be released, it is merged back into the master branch or a release branch for deployment. This approach helps us develop new features without disturbing the main code base.However, developing a feature branch might take much longer than a normal release cycle. [...] One of the techniques widely used as an alternative to feature branching is feature toggling. Feature toggles (or feature flippers) act like on/off switches. [...] We can temporarily hide a partially built or risky feature (release toggles) or limit finished stable features to a certain group of users (business toggles).
They introduce the basics of the Toggle library and it's main components: the Manager, Toggles, Operators, Conditions and Context. These are all combined together to help determine if a feature should be enabled or hidden. Examples of each are included along the way as well as one showing a toggle in action. They also show how to integrate it with a framework, in this case a Laravel project as middleware. The post ends with a look at strategies, giving you even more customization around the conditions of the toggle (example: Affirmative, Majority and Unanimous), statues and creating the conditions from either YAML or array configurations.