PHP code example of nvl / billing

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

    

nvl / billing example snippets


return [
    'enabled' => true,
    'connection' => null, // Defaults to tenancy.connection.
    'migrations' => ['enabled' => false],
    'subscription_type' => 'default',
    'prices' => [
        'pro' => ['monthly' => env('STRIPE_PRICE_PRO_MONTHLY')],
    ],
    'access' => [
        'free' => ['features' => [], 'limits' => ['projects' => 1]],
        'plans' => [
            'pro' => ['features' => ['advanced_reports'], 'limits' => ['projects' => 25]],
        ],
    ],
    'trial' => ['days' => 14, '

$snapshot = app(\Nvl\Billing\Services\BillingAccess::class)->forTenant($tenantId);

if ($snapshot->allows('advanced_reports')) {
    // Show the host-owned report.
}

$projectLimit = $snapshot->limit('projects');
bash
composer vendor:publish --tag=billing-config
php artisan vendor:publish --tag=billing-skills
php artisan vendor:publish --tag=billing-migrations
php artisan migrate
php artisan nvl:billing:doctor --strict