PHP code example of ahmadrosid / laravel-env-feature-flags

1. Go to this page and download the library: Download ahmadrosid/laravel-env-feature-flags 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/ */

    

ahmadrosid / laravel-env-feature-flags example snippets


use Ahmadrosid\FeatureFlags\Features;

if (Features::enabled('new_design')) {
    // Code for the new design feature
} else {
    // Code for the old design
}

@feature('new_design')
    <!-- Code for the new design feature -->
@else
    <!-- Code for the old design -->
@endfeature

@hasAccess('new_design')
    <!-- Code for the new design feature -->
@else
    <div class="alert alert-warning">
        You don't have access to the new design feature.
    </div>
@endhasAccess
bash
FEATURE_NEW_DESIGN=true
FEATURE_PAYMENT_GATEWAY=false
bash
FEATURE_NEW_DESIGN_USERS=1,2,3