Creating Subscriptions
Subscriptions are created using theCreateSubscription action. Inject it via the service container or resolve it with app().
Basic subscription
SubscriptionCreated event.
Subscription options
Pass an options array as the third argument:PlanItem quantities
When a plan has PlanItems (composable add-ons), pass aplan_items map to set per-item quantities at subscription time:
included_quantity.
Trials
If the plan definestrial_days, the trial starts automatically. No payment is collected until the trial ends.
To start a trial without collecting a payment method upfront, set trial_requires_payment_method to false on the plan:
CreateSubscription skips the gateway entirely. A gateway_id is assigned later when ConvertTrialToActive runs. See Trial Management for the full trial lifecycle.
Gateway selection
Subscriptions use thedefault gateway from config unless overridden:
Zero-cost plans
Plans withamount = 0 are automatically routed to the null gateway — no payment method is required and no API call is made:
Named subscriptions (multi-slot)
A user can hold multiple concurrent subscriptions by using different slot names:Handling gateway exceptions
For gateways that require Strong Customer Authentication (SCA/3DS),CreateSubscription may throw RequiresActionException:
Webhook-activated gateways (Paddle)
Paddle returns anIncomplete subscription with a checkout_url in meta. Redirect the user to complete payment:
SubscriptionCreated fires from the webhook handler once Paddle confirms payment, not from CreateSubscription.
Listening to the SubscriptionCreated event
AppServiceProvider or a dedicated provider:
Testing
Use thefake gateway in tests. It processes subscriptions synchronously without any HTTP calls:
FakeGateway setup.
Next steps
- Subscription Status — Check subscription state and dates
- Trials — Manage free trial periods
- Swapping Plans — Upgrade or downgrade mid-cycle