PHP code example of rescaled / simple-feature

1. Go to this page and download the library: Download rescaled/simple-feature library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rescaled / simple-feature example snippets


SimpleFeature::enabled('firstTest') // true
SimpleFeature::disabled('firstTest') // false
SimpleFeature::allEnabled(['firstTest', 'secondTest']) // true
SimpleFeature::allDisabled(['thirdTest', 'fourthTest']) // true
SimpleFeature::allEnabled(['firstTest', 'thirdTest']) // false
SimpleFeature::allDisabled(['firstTest', 'thirdTest']) // false

// FEATURE_REGISTRATION=true
// FEATURE_ON_PREMISE=true

Route::get('/register', [RegistrationController::class, 'create'])->middleware('feature.enabled:registration');
Route::get('/billing', [BillingController, 'show'])->middleware('feature.disabled:onPremise');