PHP code example of typicms / subscriptions

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

    

typicms / subscriptions example snippets


// config/app.php

/*
 * TypiCMS Modules Service Providers.
 * Here is the place for your modules,
 * they should be set before Core Service provider.
 */
…
TypiCMS\Modules\Subscriptions\Providers\ModuleServiceProvider::class,
…

CASHIER_MODEL=TypiCMS\Modules\Core\Models\User
MOLLIE_KEY="test_12345678912345678912345678912345"

php artisan typicms:publish Users

…
use TypiCMS\Modules\Subscriptions\Traits\BillableUser;
…
class User extends Model implements …
{
    …
    use BillableUser;
    …
}

protected $fillable = [
     'tax_percentage',
     'mollie_customer_id',
     'mollie_mandate_id',
     'tax_percentage',
     'trial_ends_at',
     'extra_billing_information'
 ];

php artisan vendor:publish --provider="Laravel\Cashier\CashierServiceProvider" --tag="cashier-views"
bash
php artisan subscriptions:install