Download the PHP package thisismahabadi/laravel-feature-flags without Composer

On this page you can find all versions of the php package thisismahabadi/laravel-feature-flags. 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-flags

Laravel feature flags

This package helps you implement feature flags in your Laravel application without a 3rd party service.

Installation

How does it work?

So it's simply using two database tables and trait (src/Traits/FeatureFlag.php) to check if the accessor (user, team, agency, etc.) has access to the requested resource or not.

Tables are:

feature_flags (to store the feature itself including its name and the date which determines the availability date.)

feature_flag_permissions (that stores which accessors [or whatever you specify] have access to what features)

After having the information in the database, all you need to do is to use the mentioned trait in any classes you want, for example, there is also a Middleware (src/Http/Middleware/CheckFeatureFlagAccess.php) which is using that trait, and you can also use it to secure your routes. To assign middleware to routes, do something like this:

Route::middleware('feature_flag:whatsapp')->post('api/v1/whatsapp', WhatsAppController@sendMessage);

The logic of the feature flag trait is that firstly it checks the feature_flags table that if the feature is valid and if so, it'll then check the feature_flag_permissions table to see if the accessor which is requesting has a correlated record in the database.

Configuration

If you execute Laravel's vendor:publish command, your file will be copied to the specified publish location, and then the configurations can be customized.

Code requirements

This part is only being used if you want the Middleware of this package.

By default, this package is using featureAccessor() belongsTo relation in the User's model as an accessor resource, and if that relation can not be found it will use the user_id who requests an endpoint.

But, Did you know you can also use another resource that you use in your company? Such as team_id, agency_id, customer_id or whatever you use.

Example for using agency_id:


All versions of laravel-feature-flags with dependencies

PHP Build Version
Package Version
No informations.
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 thisismahabadi/laravel-feature-flags contains the following files

Loading the files please wait ....