From 24e6d4069d418dfb03041f2366cdcc965f226267 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 17 Nov 2026 09:18:58 +0530 Subject: [PATCH] removed required for work_center in test certificate page --- app/Filament/Pages/TestCertificate.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Filament/Pages/TestCertificate.php b/app/Filament/Pages/TestCertificate.php index e23b5c6c..222aed15 100644 --- a/app/Filament/Pages/TestCertificate.php +++ b/app/Filament/Pages/TestCertificate.php @@ -86,8 +86,7 @@ class TestCertificate extends Page implements HasForms return Machine::where('plant_id', $plantId) ->pluck('work_center', 'id') ->toArray(); - }) - ->required(), + }), TextInput::make('production_order') ->label('Production Order') ->reactive() @@ -501,7 +500,6 @@ class TestCertificate extends Page implements HasForms $prodOrderNo = trim($prodOrderNo) ?? null; - if (!$qrcode || !preg_match('/^\d+\|\d+$/', $qrcode)) { Notification::make() ->title('Invalid QR Code') @@ -1633,10 +1631,14 @@ class TestCertificate extends Page implements HasForms $mappedMachineId = trim((string) $matchedMachineId); if ($mappedMachineId === '' || $mappedMachineId !== $selectedMachineId) { + $Mname1 = Machine::where('id', $selectedMachineId)->first(); + $workC1 = $Mname1->work_center ?? null; + $Mname2 = Machine::where('id', $mappedMachineId)->first(); + $workC2 = $Mname2->work_center ?? null; Notification::make() ->danger() ->title('Machine Mapping Mismatch') - ->body("Selected machine '{$selectedMachineId}' does not match the mapped machine '{$mappedMachineId}'.") + ->body("Selected machine '{$workC1}' does not match the mapped machine '{$workC2}'.") ->send(); return; -- 2.49.1