PHP code example of mohamedmohamedhekal / flagdeck

1. Go to this page and download the library: Download mohamedmohamedhekal/flagdeck 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/ */

    

mohamedmohamedhekal / flagdeck example snippets


use Hekal\FlagDeck\Facades\FlagDeck;
use Hekal\FlagDeck\DTOs\EvaluationContext;

FlagDeck::create([
    'key' => 'checkout.express',
    'name' => 'Express Checkout',
    'is_enabled' => true,
    'percentage' => 20,
    'onment: 'production',
));

Route::middleware('feature:checkout.express')->group(function () {
    Route::get('/checkout/express', ExpressCheckoutController::class);
});
bash
php artisan vendor:publish --tag=flagdeck-config
php artisan migrate
bash
php artisan flagdeck:set checkout.express --enable --percentage=25 --name="Express Checkout"
php artisan flagdeck:list
php artisan flagdeck:clear-cache