Skip to main content
After running php artisan subscribd:install, Subscribd publishes its configuration file to config/subscribd.php. Most values read from environment variables so you can keep credentials out of version control and vary settings between environments. This page documents every key you are likely to customize.

Gateway

KeyEnv varTypeDefaultDescription
defaultSUBSCRIBD_GATEWAYstring'stripe'The gateway driver to use when no per-call override is specified. Accepted values: 'stripe', 'paypal', 'braintree', 'fake'.
currencystring'USD'Default ISO-4217 currency code. Used when creating invoices and charges that do not specify a currency explicitly.
'default'  => env('SUBSCRIBD_GATEWAY', 'stripe'),
'currency' => 'USD',

Proration

KeyEnv varTypeDefaultDescription
proration_strategySUBSCRIBD_PRORATIONstring'now'How price changes are handled on plan swaps. 'now' = immediate credit/charge; 'renewal' = switch at next renewal; 'none' = no credit, new price at next cycle.
'proration_strategy' => env('SUBSCRIBD_PRORATION', 'now'),
You can override proration per call:
Subscribd::for($user)->swap('default', 'pro', ['prorate' => 'renewal']);

Cancellation policy

KeyEnv varTypeDefaultDescription
cancel_policystring'at_period_end'Default cancellation behavior when $immediately is not passed. 'at_period_end' = grace period; 'immediately' = instant cancellation.
'cancel_policy' => 'at_period_end',  // 'at_period_end' | 'immediately'

Dunning

Dunning controls automatic failed-payment retries. The ProcessDunning job is scheduled hourly by the service provider — no additional scheduler configuration is required.
KeyEnv varTypeDefaultDescription
dunning.enabledSUBSCRIBD_DUNNING_ENABLEDbooltrueEnable or disable automatic payment retries.
dunning.retriesarray[24, 72, 168]Hours between retry attempts after the initial failure.
dunning.cancel_after_final_retrybooltrueCancel the subscription automatically if all retries are exhausted.
'dunning' => [
    'enabled' => env('SUBSCRIBD_DUNNING_ENABLED', true),
    'retries' => [24, 72, 168],    // hours between retry attempts
    'cancel_after_final_retry' => true,
],

Tables

All table names can be overridden. This is useful when integrating Subscribd into an existing database that already has conflicting table names.
Config keyDefault table name
tables.planssubscribd_plans
tables.subscriptionssubscribd_subscriptions
tables.invoicessubscribd_invoices
tables.payment_methodssubscribd_payment_methods
tables.couponssubscribd_coupons
tables.feature_usagesubscribd_feature_usage
tables.usage_recordssubscribd_usage_records
tables.webhook_eventssubscribd_webhook_events
'tables' => [
    'plans'          => 'subscribd_plans',
    'subscriptions'  => 'subscribd_subscriptions',
    'invoices'       => 'subscribd_invoices',
    'payment_methods' => 'subscribd_payment_methods',
    'coupons'        => 'subscribd_coupons',
    'feature_usage'  => 'subscribd_feature_usage',
    'usage_records'  => 'subscribd_usage_records',
    'webhook_events' => 'subscribd_webhook_events',
],
If you override table names, do so before running migrations. Migrations read from these config keys, so changing them after running migrations will leave orphaned tables and break queries.

Plans

Plans are defined under the plans key and synced to the database with php artisan subscribd:plan sync. All prices are in minor currency units (cents for USD).
'plans' => [
    'starter' => [
        'name'           => 'Starter',
        'description'    => 'Full product access for individuals.',
        'rule'           => 'flat',        // 'flat' | 'per_unit' | 'tiered' | 'metered'
        'price'          => 1900,          // $19.00/month
        'currency'       => 'USD',
        'interval'       => 'month',       // 'day' | 'week' | 'month' | 'year'
        'interval_count' => 1,
        'trial_days'     => 14,
        'features'       => [
            'projects'   => 5,
            'api_access' => true,
            'support'    => 'email',
        ],
    ],
],

Gateways

Each gateway reads its credentials from environment variables.
'gateways' => [
    'stripe' => [
        'secret'         => env('STRIPE_SECRET'),
        'key'            => env('STRIPE_KEY'),
        'webhook_secret' => env('STRIPE_WEBHOOK_SECRET'),
    ],
],
SUBSCRIBD_GATEWAY=stripe
STRIPE_SECRET=sk_live_...
STRIPE_KEY=pk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...

Admin panel

The built-in Blade admin panel is available at /subscribd/admin by default.
KeyTypeDefaultDescription
admin.enabledbooltrueEnable or disable the admin panel routes. Set to false when using Filament resources instead.
admin.pathstring'subscribd/admin'URL path for the admin panel.
admin.middlewarearray['web', 'auth']Middleware applied to all admin routes.
'admin' => [
    'enabled'    => true,
    'path'       => 'subscribd/admin',
    'middleware' => ['web', 'auth', 'can:manage-billing'],
],
If you use Filament, set 'admin.enabled' => false to avoid duplicate management interfaces. The Filament PlanResource and SubscriptionResource are auto-registered when Filament is present.

Billables

Register every Eloquent model type that can hold subscriptions. The package uses these mappings for polymorphic queries.
'billables' => [
    'user' => \App\Models\User::class,
    'team' => \App\Models\Team::class,
],
The array key becomes the billable_type value stored in the database. If you rename a model class, add a new entry rather than changing the existing key so that historical records remain intact.

Full environment variable reference

Env varConfig keyDescription
SUBSCRIBD_GATEWAYdefaultDefault gateway driver
SUBSCRIBD_PRORATIONproration_strategyGlobal proration strategy
SUBSCRIBD_DUNNING_ENABLEDdunning.enabledEnable/disable dunning retries
STRIPE_SECRETgateways.stripe.secretStripe secret key
STRIPE_KEYgateways.stripe.keyStripe publishable key
STRIPE_WEBHOOK_SECRETgateways.stripe.webhook_secretStripe webhook signing secret
PAYPAL_CLIENT_IDgateways.paypal.client_idPayPal OAuth client ID
PAYPAL_CLIENT_SECRETgateways.paypal.client_secretPayPal OAuth client secret
PAYPAL_WEBHOOK_IDgateways.paypal.webhook_idPayPal webhook ID
PAYPAL_MODEgateways.paypal.modePayPal environment (live or sandbox)
BRAINTREE_ENVgateways.braintree.environmentBraintree environment
BRAINTREE_MERCHANT_IDgateways.braintree.merchant_idBraintree merchant ID
BRAINTREE_PUBLIC_KEYgateways.braintree.public_keyBraintree public key
BRAINTREE_PRIVATE_KEYgateways.braintree.private_keyBraintree private key