send_create_email; dispatch(function () use ($invoice, $sendEmail) { event(new InvoiceEvent\Finalized($invoice, $sendEmail)); })->afterResponse(); } /** * Handle the Invoice "updating" event. */ public function updating(Invoice $invoice): void { event(new InvoiceEvent\Updating($invoice)); } /** * Handle the Invoice "updated" event. */ public function updated(Invoice $invoice): void { if ($invoice->isDirty('status') && $invoice->status == 'paid') { event(new InvoiceEvent\Paid($invoice)); } event(new InvoiceEvent\Updated($invoice)); } /** * Handle the Invoice "deleted" event. */ public function deleted(Invoice $invoice): void { event(new InvoiceEvent\Deleted($invoice)); } }