diff --git a/app/Events/Invoice/InvoiceWasPaid.php b/app/Events/Invoice/InvoiceWasPaid.php index 34c574275a86..6f845592ce9b 100644 --- a/app/Events/Invoice/InvoiceWasPaid.php +++ b/app/Events/Invoice/InvoiceWasPaid.php @@ -1,4 +1,5 @@ company = $company; $this->event_vars = $event_vars; } + + public function broadcastOn(): array + { + return [ + // @todo: make sure this is PrivateChannel once we have auth configured. + + new Channel( + name: $this->company->company_key . '_invoices', + ), + ]; + } + + public function broadcastAs(): string + { + return 'invoice.paid'; + } }