PHP code example of webleit / laravel-spark-dynamic-plan-provider

1. Go to this page and download the library: Download webleit/laravel-spark-dynamic-plan-provider 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/ */

    

webleit / laravel-spark-dynamic-plan-provider example snippets





...

use Webleit\LaravelSparkDynamicPlanProvider\Plan;

...

Plan::create([
  'name' => 'My test plan name',
  'provider_id' => 'stripe-plan-id',
  'description' => 'test description',
  'price' => 9.99, // Tax excluded, it will apply taxes automatically using your Spark config
  'trial' => 30, // Days of trial
  'period' => Plan::PERIOD_MONTHLY, // or Plan::PERIOD_YEARLY
  'features' => [
    'feature 1',
    'feature 2'
  ]
]);


[
    /**
     * Cache Store to use for caching Spark plans.
     * Null disables the caching
     */
    'cache' => null,

    /**
     * Should the provider autoconfigure the Spark plans on boot?
     */
    'autoload' => true

]