Event Reference
Billmora's core engine dispatches events at key moments throughout the application lifecycle. Module plugins 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 module's main class, 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...
}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's 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's 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. |
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's 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's profile is updated. |
| Billing Updated | App\Events\User\BillingUpdated | User $user | A user's 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
}