Events
SaaSykit emits events that you can listen for and respond to. This is useful for things like doing certain things when a user subscribes, cancels subscription, etc like sending notifications, logging, and more.
Available Eventsโ
Registered
โ
This event is fired when a user registers.
Just like any laravel event, you can listen to it by adding a listener to your EventServiceProvider
:
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
Subscribed
โ
This event is fired when a user subscribes to a plan.
You can listen to it by adding a listener to your EventServiceProvider
:
protected $listen = [
Subscribed::class => [
SendSubscribedNotification::class,
],
];
SubscriptionCancelled
โ
This event is fired when a user cancels their subscription.
You can listen to it by adding a listener to your EventServiceProvider
:
protected $listen = [
SubscriptionCancelled::class => [
SendSubscriptionCancellationNotification::class,
],
];
InvoicePaymentFailed
โ
This event is fired when a user's invoice payment fails.
You can listen to it by adding a listener to your EventServiceProvider
:
protected $listen = [
InvoicePaymentFailed::class => [
SendInvoicePaymentFailedNotification::class,
],
];
Ordered
โ
This event is fired when a user orders a one-time purchase product.
You can listen to it by adding a listener to your EventServiceProvider
:
protected $listen = [
Ordered::class => [
SendOrderNotification::class,
],
];
OrderRefunded
โ
This event is fired when a user's order is refunded.
You can listen to it by adding a listener to your EventServiceProvider
:
protected $listen = [
OrderRefunded::class => [
SendOrderRefundedNotification::class,
],
];