Transaction event and notification changes..
This commit is contained in:
		@@ -88,4 +88,24 @@ trait Transactions
 | 
			
		||||
 | 
			
		||||
        return $key;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function storeTransactionPdfAndGetPath($transaction)
 | 
			
		||||
    {
 | 
			
		||||
        event(new \App\Events\Banking\TransactionPrinting($transaction));
 | 
			
		||||
 | 
			
		||||
        $view = view($transaction->template_path, ['revenue' => $transaction, 'transaction' => $transaction])->render();
 | 
			
		||||
        $html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
 | 
			
		||||
 | 
			
		||||
        $pdf = app('dompdf.wrapper');
 | 
			
		||||
        $pdf->loadHTML($html);
 | 
			
		||||
 | 
			
		||||
        $file_name = $this->getTransactionFileName($transaction);
 | 
			
		||||
 | 
			
		||||
        $pdf_path = storage_path('app/temp/' . $file_name);
 | 
			
		||||
 | 
			
		||||
        // Save the PDF file into temp folder
 | 
			
		||||
        $pdf->save($pdf_path);
 | 
			
		||||
 | 
			
		||||
        return $pdf_path;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user