PHP code example of renoki-co / thunder

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

    

renoki-co / thunder example snippets


use RenokiCo\Thunder\Thunder;

Thunder::plan('Unlimited Plan', 'stripe_product_id', [
    Thunder::meteredFeature('Build Minutes', 'build.minutes', 'stripe_build_minutes_price_id'),
    Thunder::meteredFeature('Seats', 'seats', 'stripe_seats_price_id'),
]);

$subscription = $user->subscription('main');

Thunder::reportUsageFor('build.minutes', $subscription, 50);
Thunder::reportUsageFor('build.minutes', $subscription, 100);

Thunder::usage('build.minutes', $subscription); // 150