From dce5b1af4524d4420c9f95a262e96c6d11dfefd9 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 24 Nov 2025 09:42:43 +0530 Subject: [PATCH] issue solved in part validation for loadign image --- .../Resources/QualityValidationResource.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/Filament/Resources/QualityValidationResource.php b/app/Filament/Resources/QualityValidationResource.php index da5e62d..8e9db0c 100644 --- a/app/Filament/Resources/QualityValidationResource.php +++ b/app/Filament/Resources/QualityValidationResource.php @@ -2301,11 +2301,20 @@ class QualityValidationResource extends Resource $fileName = $expectedValue . ".png"; // or .jpg based on your file $fullPath = storage_path("app/private/uploads/PartValidation/{$plantCodePart1}/{$fileName}"); - // Generate URL through custom route - $imageUrl = route('part.validation.image', [ - 'plant' => $plantCodePart1, - 'filename' => $fileName - ]); + // // Generate URL through custom route + // $imageUrl = route('part.validation.image', [ + // 'plant' => $plantCodePart1, + // 'filename' => $fileName + // ]); + if (file_exists($fullPath)) { + $imageUrl = route('part.validation.image', [ + 'plant' => $plantCodePart1, + 'filename' => $fileName + ]); + } else { + // URL for default placeholder image in public/images + $imageUrl = asset("images/not_found.png"); + } $set('part_validation1_error_image', $imageUrl); return;