Skip to content

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:

php
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

EventClassPropertiesDispatched When
CreatedApp\Events\Invoice\CreatedInvoice $invoice, bool $sendEmailA new invoice is generated.
GeneratedApp\Events\Invoice\GeneratedInvoice $invoiceAn invoice is auto-generated by the billing cycle.
PaidApp\Events\Invoice\PaidInvoice $invoiceAn invoice is marked as paid.
OverdueApp\Events\Invoice\OverdueInvoice $invoiceAn invoice passes its due date without payment.
RefundedApp\Events\Invoice\RefundedInvoice $invoiceAn 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

EventClassPropertiesDispatched When
CreatedApp\Events\Order\CreatedOrder $orderA new order is placed by a client.
CancelledApp\Events\Order\CancelledOrder $orderAn order is cancelled.

Payment Events

EventClassPropertiesDispatched When
CapturedApp\Events\PaymentCapturedInvoice $invoice, Plugin $plugin, GatewayCallbackResponse $responseA 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

EventClassPropertiesDispatched When
CreatedApp\Events\Service\CreatedService $serviceA new service is created (status: pending).
Provisioning ActivatedApp\Events\Service\ProvisioningActivatedService $serviceA service is successfully provisioned and activated.
Provisioning FailedApp\Events\Service\ProvisioningFailedService $serviceProvisioning fails for a service.
Provisioning SuspendedApp\Events\Service\ProvisioningSuspendedService $serviceA service is suspended on the remote provider.
Provisioning UnsuspendedApp\Events\Service\ProvisioningUnsuspendedService $serviceA suspended service is reactivated.
Provisioning TerminatedApp\Events\Service\ProvisioningTerminatedService $serviceA service is terminated on the remote provider.
Provisioning RenewedApp\Events\Service\ProvisioningRenewedService $serviceA service is renewed after payment.
Provisioning ScaledApp\Events\Service\ProvisioningScaledService $serviceA service resources are scaled/upgraded.

Service Cancellation Events

EventClassPropertiesDispatched When
RequestedApp\Events\ServiceCancellation\RequestedServiceCancellation $cancellationA client requests cancellation of a service.
ApprovedApp\Events\ServiceCancellation\ApprovedServiceCancellation $cancellationAn admin approves a cancellation request.
RejectedApp\Events\ServiceCancellation\RejectedServiceCancellation $cancellationAn admin rejects a cancellation request.

Registrant Events

EventClassPropertiesDispatched When
CreatedApp\Events\Registrant\CreatedRegistrant $registrantA new domain registrant record is created.
Registration CompletedApp\Events\Registrant\RegistrationCompletedRegistrant $registrantDomain registration is successfully completed.
Registration FailedApp\Events\Registrant\RegistrationFailedRegistrant $registrantDomain registration fails.
RenewedApp\Events\Registrant\RenewedRegistrant $registrantA domain is successfully renewed.

Domain Events

EventClassPropertiesDispatched When
RegisteredApp\Events\Domain\RegisteredRegistrant $registrantA domain is successfully registered.
Registration FailedApp\Events\Domain\RegistrationFailedRegistrant $registrantDomain registration attempt fails.
RenewedApp\Events\Domain\RenewedRegistrant $registrantA domain is successfully renewed.
ExpiredApp\Events\Domain\ExpiredRegistrant $registrantA domain has expired.
SuspendedApp\Events\Domain\SuspendedRegistrant $registrantA domain is suspended.
UnsuspendedApp\Events\Domain\UnsuspendedRegistrant $registrantA suspended domain is reactivated.

Ticket Events

EventClassPropertiesDispatched When
CreatedApp\Events\Ticket\CreatedTicket $ticketA new support ticket is opened.
RepliedApp\Events\Ticket\RepliedTicket $ticketA reply is posted on a ticket.
AssignedApp\Events\Ticket\AssignedTicket $ticketA ticket is assigned to a staff member.
Status ChangedApp\Events\Ticket\StatusChangedTicket $ticketA ticket status changes.
ClosedApp\Events\Ticket\ClosedTicket $ticketA ticket is closed.

Transaction Events

EventClassPropertiesDispatched When
CreatedApp\Events\Transaction\CreatedTransaction $transactionA new transaction record is created.

User Events

EventClassPropertiesDispatched When
CreatedApp\Events\User\CreatedUser $userA new user account is created (by admin).
RegisteredApp\Events\User\RegisteredUser $userA user registers via the portal.
UpdatedApp\Events\User\UpdatedUser $userA user profile is updated.
Billing UpdatedApp\Events\User\BillingUpdatedUser $userA user billing information is updated.
Password Reset RequestedApp\Events\User\PasswordResetRequestedUser $userA user requests a password reset.
Verification ResentApp\Events\User\VerificationResentUser $userAn email verification is resent.

Since event properties are Eloquent model instances, you can access all relationships:

php
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
}