public function emailInvoice(Invoice $invoice, $isReminder = 0) { $sender = $invoice->pandaw ? ['email' => '*****@*****.**', 'name' => null] : ['email' => '*****@*****.**', 'name' => 'Sayang Holidays']; $receiver = ['email' => $invoice->user->email, 'name' => $invoice->user->fullName()]; $subject = 'Invoice # ' . $invoice->invoiceId(); $view = $this->getEmailContent($invoice->pandaw, $isReminder); $bcc = true; $attachments = $this->getAttachments($invoice->invoiceId()); $data = compact('bcc', 'invoice', 'attachments'); $this->sendTo($sender, $receiver, $subject, $view, $data); }