Event Reference
Billmora core engine dispatches events at key moments throughout the application lifecycle. All plugin types (Module, Provisioning, Gateway, Registrar) can subscribe to these events via getSubscribedEvents() to react in real-time — without modifying any core code.
Each event is a simple PHP class with public readonly properties that expose the relevant Eloquent model(s).
How to Subscribe
In your plugin main class (any type: Module, Provisioning, Gateway, or Registrar), map event classes to handler methods:
public function getSubscribedEvents(): array
{
return [
\App\Events\Invoice\Paid::class => "onInvoicePaid",
];
}
public function onInvoicePaid(\App\Events\Invoice\Paid $event): void
{
$invoice = $event->invoice;
// React to the event...
}Shared Capability
This feature works for all plugin types. See Plugin Capabilities Reference → Event Subscription for practical use case examples per plugin type.
Invoice Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\Invoice\Created | Invoice $invoice, bool $sendEmail | A new invoice is generated. |
| Generated | App\Events\Invoice\Generated | Invoice $invoice | An invoice is auto-generated by the billing cycle. |
| Paid | App\Events\Invoice\Paid | Invoice $invoice | An invoice is marked as paid. |
| Overdue | App\Events\Invoice\Overdue | Invoice $invoice | An invoice passes its due date without payment. |
| Refunded | App\Events\Invoice\Refunded | Invoice $invoice | An invoice is refunded. |
TIP
Invoice\Created includes a $sendEmail boolean flag. When true, Billmora will also dispatch email notifications. Your module can check this flag to avoid sending duplicate notifications.
Order Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\Order\Created | Order $order | A new order is placed by a client. |
| Cancelled | App\Events\Order\Cancelled | Order $order | An order is cancelled. |
Payment Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Captured | App\Events\PaymentCaptured | Invoice $invoice, Plugin $plugin, GatewayCallbackResponse $response | A payment is successfully captured by a gateway. |
INFO
PaymentCaptured is primarily used internally by Billmora core engine to process invoice payments. Module plugins can subscribe to it for logging, analytics, or external integrations — but use Invoice\Paid for simpler payment-complete reactions.
Service Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\Service\Created | Service $service | A new service is created (status: pending). |
| Provisioning Activated | App\Events\Service\ProvisioningActivated | Service $service | A service is successfully provisioned and activated. |
| Provisioning Failed | App\Events\Service\ProvisioningFailed | Service $service | Provisioning fails for a service. |
| Provisioning Suspended | App\Events\Service\ProvisioningSuspended | Service $service | A service is suspended on the remote provider. |
| Provisioning Unsuspended | App\Events\Service\ProvisioningUnsuspended | Service $service | A suspended service is reactivated. |
| Provisioning Terminated | App\Events\Service\ProvisioningTerminated | Service $service | A service is terminated on the remote provider. |
| Provisioning Renewed | App\Events\Service\ProvisioningRenewed | Service $service | A service is renewed after payment. |
| Provisioning Scaled | App\Events\Service\ProvisioningScaled | Service $service | A service resources are scaled/upgraded. |
Service Cancellation Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Requested | App\Events\ServiceCancellation\Requested | ServiceCancellation $cancellation | A client requests cancellation of a service. |
| Approved | App\Events\ServiceCancellation\Approved | ServiceCancellation $cancellation | An admin approves a cancellation request. |
| Rejected | App\Events\ServiceCancellation\Rejected | ServiceCancellation $cancellation | An admin rejects a cancellation request. |
Registrant Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\Registrant\Created | Registrant $registrant | A new domain registrant record is created. |
| Registration Completed | App\Events\Registrant\RegistrationCompleted | Registrant $registrant | Domain registration is successfully completed. |
| Registration Failed | App\Events\Registrant\RegistrationFailed | Registrant $registrant | Domain registration fails. |
| Renewed | App\Events\Registrant\Renewed | Registrant $registrant | A domain is successfully renewed. |
Domain Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Registered | App\Events\Domain\Registered | Registrant $registrant | A domain is successfully registered. |
| Registration Failed | App\Events\Domain\RegistrationFailed | Registrant $registrant | Domain registration attempt fails. |
| Renewed | App\Events\Domain\Renewed | Registrant $registrant | A domain is successfully renewed. |
| Expired | App\Events\Domain\Expired | Registrant $registrant | A domain has expired. |
| Suspended | App\Events\Domain\Suspended | Registrant $registrant | A domain is suspended. |
| Unsuspended | App\Events\Domain\Unsuspended | Registrant $registrant | A suspended domain is reactivated. |
Ticket Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\Ticket\Created | Ticket $ticket | A new support ticket is opened. |
| Replied | App\Events\Ticket\Replied | Ticket $ticket | A reply is posted on a ticket. |
| Assigned | App\Events\Ticket\Assigned | Ticket $ticket | A ticket is assigned to a staff member. |
| Status Changed | App\Events\Ticket\StatusChanged | Ticket $ticket | A ticket status changes. |
| Closed | App\Events\Ticket\Closed | Ticket $ticket | A ticket is closed. |
Transaction Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\Transaction\Created | Transaction $transaction | A new transaction record is created. |
User Events
| Event | Class | Properties | Dispatched When |
|---|---|---|---|
| Created | App\Events\User\Created | User $user | A new user account is created (by admin). |
| Registered | App\Events\User\Registered | User $user | A user registers via the portal. |
| Updated | App\Events\User\Updated | User $user | A user profile is updated. |
| Billing Updated | App\Events\User\BillingUpdated | User $user | A user billing information is updated. |
| Password Reset Requested | App\Events\User\PasswordResetRequested | User $user | A user requests a password reset. |
| Verification Resent | App\Events\User\VerificationResent | User $user | An email verification is resent. |
Accessing Related Data
Since event properties are Eloquent model instances, you can access all relationships:
public function onInvoicePaid(\App\Events\Invoice\Paid $event): void
{
$invoice = $event->invoice;
$user = $invoice->user; // The client who owns the invoice
$items = $invoice->items; // Invoice line items
$amount = $invoice->total; // Total amount
$currency = $invoice->currency; // Currency code (e.g., "USD")
}
public function onServiceActivated(\App\Events\Service\ProvisioningActivated $event): void
{
$service = $event->service;
$user = $service->user; // The client who owns the service
$package = $service->package; // The package/product purchased
$config = $service->configuration; // Service-specific configuration
}
public function onRegistrantCreated(\App\Events\Registrant\Created $event): void
{
$registrant = $event->registrant;
$user = $registrant->user; // The client who owns the domain
$domain = $registrant->domain; // The domain name
$years = $registrant->years; // Registration period
}