issue solved in part validation for loadign image
This commit is contained in:
@@ -2301,11 +2301,20 @@ class QualityValidationResource extends Resource
|
|||||||
$fileName = $expectedValue . ".png"; // or .jpg based on your file
|
$fileName = $expectedValue . ".png"; // or .jpg based on your file
|
||||||
$fullPath = storage_path("app/private/uploads/PartValidation/{$plantCodePart1}/{$fileName}");
|
$fullPath = storage_path("app/private/uploads/PartValidation/{$plantCodePart1}/{$fileName}");
|
||||||
|
|
||||||
// Generate URL through custom route
|
// // Generate URL through custom route
|
||||||
|
// $imageUrl = route('part.validation.image', [
|
||||||
|
// 'plant' => $plantCodePart1,
|
||||||
|
// 'filename' => $fileName
|
||||||
|
// ]);
|
||||||
|
if (file_exists($fullPath)) {
|
||||||
$imageUrl = route('part.validation.image', [
|
$imageUrl = route('part.validation.image', [
|
||||||
'plant' => $plantCodePart1,
|
'plant' => $plantCodePart1,
|
||||||
'filename' => $fileName
|
'filename' => $fileName
|
||||||
]);
|
]);
|
||||||
|
} else {
|
||||||
|
// URL for default placeholder image in public/images
|
||||||
|
$imageUrl = asset("images/not_found.png");
|
||||||
|
}
|
||||||
|
|
||||||
$set('part_validation1_error_image', $imageUrl);
|
$set('part_validation1_error_image', $imageUrl);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user