Skip to main content

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.

As of Laravel 11, event listeners are automatically triggered when an event is fired. You don't need to manually register the event listeners.

Available Eventsโ€‹

Registeredโ€‹

This event is fired when a user registers.

Subscribedโ€‹

This event is fired when a user subscribes to a plan.

SubscriptionCancelledโ€‹

This event is fired when a user cancels their subscription.

SubscriptionRenewedโ€‹

This event is fired when a user's subscription is renewed (you might use this to provision resources for the user if the nature of your application requires it).

InvoicePaymentFailedโ€‹

This event is fired when a user's invoice payment fails.

Orderedโ€‹

This event is fired when a user orders a one-time purchase product.

OrderRefundedโ€‹

This event is fired when a user's order is refunded.

SaaSykit Tenancy Eventsโ€‹

SaaSykit Tenancy offer events that you can listen to in your application to get notified when a user is added to a tenant, removed from a tenant, or invited to a tenant. You might need to take actions when a users is added to a tenant to provision resources for them, or when a user is removed from a tenant to de-provision resources for them, and so on.

UserInvitedToTenantโ€‹

This event is fired when a user is invited to a tenant. It takes the Invitation model which contains the details of the invitation and the Tenant to which the user is invited.

UserJoinedTenantโ€‹

This event is fired when a user joins a tenant (accepts invitation). It takes the User and the Tenant model as arguments.

UserRemovedFromTenantโ€‹

This event is fired when a user is removed from a tenant. It takes the User and the Tenant model as arguments.

Defining Event Listenersโ€‹

You can check the Laravel documentation for more information on how to define event listeners.