Skip to main content

Canceling Subscriptions

The CancelSubscription action cancels a subscription at the gateway and updates the local record. All cancellation logic runs inside a database transaction and fires SubscriptionCanceled on success.

Cancel at period end (default)

The default cancel policy leaves the subscription active until the current billing period ends:
The subscription enters Grace status. The user retains full access until ends_at, after which the subscription transitions to Canceled. The number of grace period days is configured globally:

Cancel immediately

Pass true as the second argument to cancel without a grace period:
The subscription transitions directly to Canceled. The user loses access immediately.

Per-plan cancel policy

Set a cancel_policy on individual plans to override the global default:
When $immediately is false, the per-plan policy is honoured. When $immediately is true, the subscription is always canceled instantly regardless of the plan policy.

Checking cancellation status

The ManagesBilling trait also provides:

Resuming a canceled subscription

A subscription in Grace status can be un-canceled before ends_at:
This reinstates the subscription at the gateway, clears the canceled_at and ends_at dates, and sets the status back to Active.

Listening to cancellation events

Canceling all subscriptions on account deletion

The SubscriptionManager Livewire component

The subscription-manager component includes a cancel flow with an optional confirmation modal and resume button for grace-period subscriptions:
See Livewire Components for props and events.

Next steps

  • Pausing — Pause billing without canceling
  • Dunning — Retry failed payments before a subscription is canceled
  • Hooks and Events — Full event reference