mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Merge branch 'pdf-ext' into 'master'
fix pdf extenstion issue See merge request mohit.panjvani/crater-web!641
This commit is contained in:
@ -14,11 +14,10 @@ trait GeneratesPdfTrait
|
|||||||
public function getGeneratedPDFOrStream($collection_name)
|
public function getGeneratedPDFOrStream($collection_name)
|
||||||
{
|
{
|
||||||
$pdf = $this->getGeneratedPDF($collection_name);
|
$pdf = $this->getGeneratedPDF($collection_name);
|
||||||
|
|
||||||
if($pdf && file_exists($pdf['path'])) {
|
if($pdf && file_exists($pdf['path'])) {
|
||||||
return response()->make(file_get_contents($pdf['path']), 200, [
|
return response()->make(file_get_contents($pdf['path']), 200, [
|
||||||
'Content-Type' => 'application/pdf',
|
'Content-Type' => 'application/pdf',
|
||||||
'Content-Disposition' => 'inline; filename="'.$pdf['file_name'].'"'
|
'Content-Disposition' => 'inline; filename="'.$pdf['file_name'].'.pdf"'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +29,7 @@ trait GeneratesPdfTrait
|
|||||||
|
|
||||||
return response()->make($pdf->stream(), 200, [
|
return response()->make($pdf->stream(), 200, [
|
||||||
'Content-Type' => 'application/pdf',
|
'Content-Type' => 'application/pdf',
|
||||||
'Content-Disposition' => 'inline; filename="'.$this[$collection_name.'_number'].'"'
|
'Content-Disposition' => 'inline; filename="'.$this[$collection_name.'_number'].'.pdf"'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user