From c342d54c7b6972934a840b1bf1bdebb6df850cbc Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 1 Dec 2026 15:33:09 +0530 Subject: [PATCH] Added logic for pdf shown in mail --- .../RequestCharacteristicResource.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/app/Filament/Resources/RequestCharacteristicResource.php b/app/Filament/Resources/RequestCharacteristicResource.php index 9533443b..2c736ed7 100644 --- a/app/Filament/Resources/RequestCharacteristicResource.php +++ b/app/Filament/Resources/RequestCharacteristicResource.php @@ -185,7 +185,29 @@ class RequestCharacteristicResource extends Resource } // Build filename - $fileName = "{$workFlowId}.png"; + // $fileName = "{$workFlowId}.png"; + + // $imageUrl = route('workflow.image', [ + // 'filename' => $fileName, + // ]); + + // $set('validation1_image_url', $imageUrl); + + $files = glob(storage_path("app/private/uploads/LaserDocs/{$workFlowId}.*")); + + if (empty($files)) { + $set('validation1_image_url', null); + + Notification::make() + ->title('Validation File Not Found') + ->body("No validation image or PDF found for Workflow ID: {$workFlowId}") + ->warning() + ->send(); + + return; + } + + $fileName = basename($files[0]); $imageUrl = route('workflow.image', [ 'filename' => $fileName,