Pixelworxio\Subscribd\Events\ and are fired after the corresponding database write completes, so event listeners always work with fully persisted model state. Register listeners in your EventServiceProvider using standard Laravel patterns — closure listeners, queued listeners, and subscriber classes all work.
Registering listeners
AppServiceProvider::boot():
Events reference
SubscriptionCreated
Fired after a new subscription is persisted to the database and confirmed on the gateway. Payload:$event->subscription — the newly created Subscription model.
SubscriptionUpdated
Fired after a plan swap completes — both the gateway record and the localSubscription model have been updated.
Payload: $event->subscription — the updated Subscription model with the new plan_id.
SubscriptionCanceled
Fired after a cancellation is recorded. The subscription may be ingrace status (cancel at period end) or canceled status (immediate cancellation) at the time the event fires.
Payload: $event->subscription — the canceled Subscription model.
InvoiceCreated
Fired when a new invoice is created, before payment is attempted. Useful for adding line items, applying tax, or logging. Payload:$event->invoice — the newly created Invoice model.
PaymentSucceeded
Fired after an invoice is paid successfully. Use it to provision access, send receipts, or update your records. Payload:$event->invoice — the paid Invoice model with status = 'paid'.
PaymentFailed
Fired when a payment attempt fails — either on the initial charge or during a dunning retry. Both$event->invoice and the human-readable $event->message from the gateway are available.
Payload: $event->invoice — the Invoice model with status = 'failed'. $event->message — gateway error string.
TrialEnding
Fired when a trial subscription is approaching its end. Subscribd fires this event before the trial expires so you can prompt the subscriber to add a payment method. Payload:$event->subscription — the trialing Subscription model. $event->daysRemaining — integer count of days left in the trial.
Event summary
| Event | Property | Type | When fired |
|---|---|---|---|
SubscriptionCreated | $subscription | Subscription | After a new subscription is persisted |
SubscriptionUpdated | $subscription | Subscription | After a plan swap completes |
SubscriptionCanceled | $subscription | Subscription | After a cancellation is recorded |
InvoiceCreated | $invoice | Invoice | When a new invoice is created |
PaymentSucceeded | $invoice | Invoice | After successful payment |
PaymentFailed | $invoice, $message | Invoice, string | After a failed payment attempt |
TrialEnding | $subscription, $daysRemaining | Subscription, int | When a trial is nearing its end |
All events are standard Laravel events and work with any driver — synchronous, queued, or broadcast. Queued listeners are the recommended approach for side effects like sending email or calling external APIs.