Plans
Plans are the foundation of Subscribd’s billing model. They’re defined inconfig/subscribd.php and synced to the subscribd_plans database table via php artisan subscribd:install. Version-controlling your plan definitions in config means plan changes are code-reviewed and deployable like any other application change.
Defining a plan
Required fields
| Field | Type | Description |
|---|---|---|
name | string | Display name shown in UI |
rule | string | Pricing rule: flat, per_unit, tiered, or metered |
amount | int | Price in minor currency units (e.g. cents for USD) |
interval | string | Billing cycle: day, week, month, or year |
Optional fields
| Field | Type | Default | Description |
|---|---|---|---|
description | string | null | Plan description for display |
interval_count | int | 1 | Number of intervals per billing period |
is_recurring | bool | true | Set false for lifetime or one-time plans (excluded from MRR/ARR) |
trial_days | int | 0 | Free trial length in days |
features | array | [] | Feature keys and limits; true for boolean access, integer for limits |
trial_requires_payment_method | bool | true | Set false to start trials without collecting a card |
cancel_policy | string | config default | at_period_end, immediately, or immediately_with_refund |
Pricing rules
Therule field maps to a pricing class that controls how charges are calculated.
Flat rate
A single recurring charge regardless of usage or quantity:Per unit
Charge per seat, user, or any countable unit:Tiered
Price changes at volume breakpoints:Metered
Charge based on actual usage reported at the end of each billing period:Plan items
PlanItems are composable add-ons that attach to a plan. Each item has akey, an included_quantity, and a unit_price for overages. They’re defined in the database via the Filament admin panel or via the plan:item Artisan command, and sync to subscribd_plan_items.
When a subscription is created, Subscribd hydrates one SubscriptionItem record per active PlanItem on the plan. Customers can select per-item quantities at checkout via the PlanPicker Livewire component.
Free plans
Setamount to 0 to create a free plan. Subscribd automatically routes zero-cost subscriptions through the null gateway — no payment method is required and no gateway API call is made:
Lifetime plans
Setis_recurring to false for one-time charges that never renew. Lifetime plans are excluded from MRR and ARR calculations:
Syncing plans to the database
After modifyingconfig/subscribd.php, run:
subscribd_plans table from config. Existing subscriptions are unaffected — the plan record is updated in place, not replaced.
You can also manage plans directly in the Filament admin panel at /subscribd/admin.
Next steps
- Creating Subscriptions — Subscribe a billable to a plan
- Billing Scenarios — Deep dives for each pricing rule
- Components — The PlanPicker and Checkout Livewire components