Skip to main content

Installation

Get Subscribd installed and configured in a few minutes.

Requirements

  • PHP 8.3 or higher
  • Laravel 12 or 13
  • A supported database (MySQL, PostgreSQL, or SQLite)

Install via Composer

Subscribd is distributed through a private Composer repository. Add the repository and require the package:
composer require pixelworxio/subscribd
The service provider registers itself automatically via Laravel’s package discovery. Two facades are aliased for convenience: Subscribd and Entitlements.

Publish assets

Configuration

php artisan vendor:publish --tag=subscribd-config
This creates config/subscribd.php. At minimum, set your default gateway and currency:
// config/subscribd.php
return [
    'default'  => env('SUBSCRIBD_GATEWAY', 'stripe'),
    'currency' => env('SUBSCRIBD_CURRENCY', 'USD'),

    'billables' => [
        'user' => \App\Models\User::class,
    ],
    // ...
];

Migrations

php artisan vendor:publish --tag=subscribd-migrations
php artisan migrate
This creates the following tables:
TablePurpose
subscribd_plansPlan definitions synced from config
subscribd_plan_itemsComposable add-ons per plan
subscribd_subscriptionsActive and historical subscriptions
subscribd_subscription_itemsPer-subscription PlanItem quantities
subscribd_invoicesAll charges and their status
subscribd_invoice_linesLine items on each invoice
subscribd_payment_methodsStored customer payment instruments
subscribd_couponsDiscount codes
subscribd_creditsAccount credit balance
subscribd_usage_recordsMetered billing usage
subscribd_webhook_eventsIdempotent webhook log

Livewire components and views

php artisan vendor:publish --tag=subscribd-views
Published to resources/views/vendor/subscribd/.

Translation files

php artisan vendor:publish --tag=subscribd-translations
Published to lang/vendor/subscribd/. Ships with en, es, fr, de, and zh-CN.

Environment variables

Add your gateway credentials to .env. Only the gateway you intend to use is required:
SUBSCRIBD_GATEWAY=stripe
SUBSCRIBD_CURRENCY=USD

# Stripe
STRIPE_KEY=pk_live_...
STRIPE_SECRET=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...

# PayPal
PAYPAL_CLIENT_ID=...
PAYPAL_CLIENT_SECRET=...
PAYPAL_WEBHOOK_ID=...
PAYPAL_MODE=live

# Braintree
BRAINTREE_ENV=production
BRAINTREE_MERCHANT_ID=...
BRAINTREE_PUBLIC_KEY=...
BRAINTREE_PRIVATE_KEY=...

# Paddle
PADDLE_API_KEY=...
PADDLE_WEBHOOK_SECRET=...

# FastSpring
FASTSPRING_USERNAME=...
FASTSPRING_PASSWORD=...
FASTSPRING_WEBHOOK_SECRET=...
FASTSPRING_STOREFRONT_URL=...

# Square
SQUARE_ACCESS_TOKEN=...
SQUARE_APPLICATION_ID=...
SQUARE_LOCATION_ID=...
SQUARE_WEBHOOK_SIGNATURE_KEY=...

Sync plans

After publishing the configuration and defining your plans, sync them to the database:
php artisan subscribd:install
This seeds the subscribd_plans and subscribd_plan_items tables from your config/subscribd.php plans array.

Run the health check

Verify the installation and gateway connectivity:
php artisan subscribd:check
The command reports your configured gateway, currency, registered billable types, and plan count.

Schedule recurring commands

Add the following to your routes/console.php (or app/Console/Kernel.php on Laravel 10) to enable dunning, trial expiry, and ARR snapshots:
use Illuminate\Support\Facades\Schedule;

Schedule::command('subscribd:expire-subscriptions')->daily();
Schedule::command('subscribd:expire-trials')->hourly();
Schedule::command('subscribd:dispatch-trial-ending-events')->daily();
Schedule::command('subscribd:check-payment-method-expiry')->daily();
Schedule::command('subscribd:snapshot-arr')->dailyAt('00:00');

Next steps