From ce55b65585c0198b923968f8d51005aac09a9bfc Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Sun, 12 Jan 2025 10:55:39 +0600 Subject: [PATCH] configurable template --- app/Services/Export/Formats/Word2007Export.php | 4 ++-- config/services.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Services/Export/Formats/Word2007Export.php b/app/Services/Export/Formats/Word2007Export.php index bfd80fc..a5ed8db 100644 --- a/app/Services/Export/Formats/Word2007Export.php +++ b/app/Services/Export/Formats/Word2007Export.php @@ -16,10 +16,10 @@ protected function handle(): string $filename = $this->filename(); $filepath = ReportStorage::customFilepath($this->study, $filename); if (ReportStorage::exists($this->study, $filename)) { - return $filepath; + // return $filepath; } - $docx = new CreateDocxFromTemplate(Storage::disk('local')->path('report/report-template-gray.docx')); + $docx = new CreateDocxFromTemplate(Storage::disk('local')->path(config('services.report.word2007.template'))); $variables = [ 'PAT_NAME' => $this->report->study->patient_name, 'PAT_ID' => $this->report->study->patient_id, diff --git a/config/services.php b/config/services.php index 27a3617..c2dbc68 100644 --- a/config/services.php +++ b/config/services.php @@ -35,4 +35,10 @@ ], ], + 'report' => [ + 'word2007' => [ + 'template' => env('REPORT_TEMPLATE_WORD2007', 'report/report-template-gray.docx'), + ], + ], + ];