Download the PHP package harryjhonny/laravel-feature-flag without Composer

On this page you can find all versions of the php package harryjhonny/laravel-feature-flag. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-feature-flag

Feature Flags for Laravel

A Feature flag is sometimes also 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 continuous integrate and continuous deployment. 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:

Once installed you should publish the config with the following command.

You can customise the features.php config in a number of ways. By default four storage drivers for the feature flags are provided, config, database, redis and chain. the first three are pretty straight forward but the chain is essentially a composite that allows you to store across all three. For example you might want to query a feature that's hardcoded in the config. If it does not exist it will then go on to check redis. If it's not stored there, then it'll check the database. Afterwards it can update the other sources to improve flag checking times.

To use the Database driver you will need to add the migration. You can do this by using the publish command.

Everything is enabled by default but if you want to turn off several features add the following method calls to the boot method of app/Providers/AppServiceProvider.php in your project.

To install the middleware you'll have to add it to your $routeMiddleware inside app/Http/Kernel.php file.

Usage

Checking feature accessibility

You can use the accessible method to check if a feature is on or off.

Blade Views

the @feature blade directive is a simple @if shortcut to hide or display certain parts of the view depending on the state of the feature. A second argument flips the state e.g. it will display the contents of the if statement if the feature is off.

Routing Middleware

The middleware will cause routes to be blocked if the specified feature does not have the correct state.

Validation Rules

Fields can be marked as required depending on if the feature is in a particular state.

Task Scheduling

Using the following will determine if a task will run on schedule depending on the state of the feature.

Artisan Commands

You may run the following commands to toggle the on or off state of the feature.

To find out the current state of the feature within the context of a console command, run the following:


All versions of laravel-feature-flag with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
illuminate/support Version 5.7.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package harryjhonny/laravel-feature-flag contains the following files

Loading the files please wait ....