expenseRepo = $expenseRepo; } public function deletedInvoice(InvoiceWasDeleted $event) { // Release any tasks associated with the deleted invoice Expense::where('invoice_id', '=', $event->invoice->id) ->update(['invoice_id' => null]); } }