Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2024-06-17 (3 months ago) | | Not enough user ratings | | Total: 10 This week: 1 | | All time: 11,412 This week: 44 |
|
Description | | Author |
This package can enable and disable features of the Laravel application.
It provides a class to store the details of features of a Laravel application, such as the feature name, description, users that have the feature enabled, period of availability of the feature, etc...
The class can check if a given feature is currently enabled.
Features can be enabled and disabled with Artisan. Innovation Award
June 2024
Number 6 |
Many applications have features that provide benefits to the application users.
When a feature is implemented, it is a good practice to test it well, eventually with a group of users.
This package allows testing features of Laravel applications restricting access to each feature to a group of users.
The control of enabled features can be done using the Artisan tool.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 2x |
|
Instructions
Usage
//Feature Flagging can be simple done by creating the flag
$featureFlag = new FeatureFlag([
'name' => 'test',
'description' => 'Test feature flag',
]);
$featureFlag->save();
//using the flag to scope your your code using if condition or any other way you like
if ($featureFlag->isEnabled()) {
// Implement the feature for the user
}
//or you can use the method Targted and checking the audience to match to specific audience
if($featureFlag->isTargeted() && in_array($user->id, $featureFlag->getAudience())) {
// Implement the feature for the user
}
//Feature Flagging can be also used to target users based on percentage
$featureFlag = new FeatureFlag([
'name' => 'test',
'description' => 'Test feature flag',
'percentage'=>50
]);
$featureFlag->save();
// you can use the method isEnabledForUser and checking the audience to match to specific audience i.e 50%
if($featureFlag->isEnabledForUser($user)) {
// Implement the feature for the user
}
//Feature Flagging can be also used to flag based on datetime
$featureFlag = new FeatureFlag([
'name' => 'test flag',
'finish_date' => '01/04/2023',
'enabled' => true,
]);
$featureFlag->save();
// you can use the env either to throw an exception or send a notification when flag expires
if($featureFlag->isEnabled()) {
// Implement the feature for the user
}
//then simply call feature-flag:manage followed by the name of your flag to enable Or disable it
php artisan feature-flag:manage {flag : The name of the feature flag}
{--enable : Enable the feature flag} {--disable : Disable the feature flag}
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.