<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
matthiaswilbrink / laravel-feature-toggles example snippets
[...]
@feature('name_of_my_feature_as_string')
This will show when the feature is enabled
@endfeature
[...]
[...]
@feature('name_of_my_feature_as_string')
This will show when the feature is enabled.
@else
This will show when the feature is disabled.
@endfeature
[...]
if (feature('name_of_my_feature_as_string')){
//do something
}
// Check if a feature is enabled
if (Feature::isEnabled('name_of_my_feature_as_string')){
//do something
}
// A shorter alias
if (Feature::isOn('name_of_my_feature_as_string')){
//do something
}
public function someMethod(FeatureManager $featureManager)
{
if ($featureManager->isEnabled('name_of_my_feature_as_string')){
//do something
}
}
public function turnTheSnowFlakesOn(FeatureManager $featureManager)
{
$featureManager->enable('homepage_snowflakes_animation');
}