userMailer = $userMailer; $this->contactMailer = $contactMailer; } /** * Handle the event. * * @param InvoicePaid $event * @return void */ public function handle(InvoicePaid $event) { $this->contactMailer->sendPaymentConfirmation($payment); $invoice = $payment->invoice; foreach ($invoice->account->users as $user) { if ($user->{'notify_paid'}) { $this->userMailer->sendNotification($user, $invoice, 'paid', $payment); } } } }