Merge pull request #303 from Destination-Design/patch_pdf_upload

Fixed Invoice object in Mailer instance.
This commit is contained in:
Jeramy Simpson 2015-05-06 13:51:04 +10:00
commit e4963fef66

View File

@ -22,7 +22,7 @@ class Mailer
}
if(isset($data['invoice_id'])) {
$invoice = Invoice::scope($data['invoice_id'])->with(['account'])->first();
$invoice = Invoice::scope()->with("account")->where('id', '=', $data['invoice_id'])->get()->first();
$pdfPath = storage_path().'/pdfcache/cache-'.$invoice->id.'.pdf';
if($invoice->account->pdf_email_attachment && file_exists($pdfPath)) {
$message->attach(