From baf41cfea107716fe198c0dfa611cb4a5aeb302d Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 23 Oct 2026 17:24:16 +0530 Subject: [PATCH] changed regex pattern in panel box inspection page --- app/Filament/Pages/PanelBoxInspectionStock.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Filament/Pages/PanelBoxInspectionStock.php b/app/Filament/Pages/PanelBoxInspectionStock.php index 348f4d8f..20eeeb40 100644 --- a/app/Filament/Pages/PanelBoxInspectionStock.php +++ b/app/Filament/Pages/PanelBoxInspectionStock.php @@ -288,11 +288,11 @@ class PanelBoxInspectionStock extends Page { $parts = explode('/', $itemId); - if (count($parts) < 4) { + if (!preg_match('/^\d+\/\d+\/\d{4}\/\d+$/', $itemId) || preg_match('/[a-zA-Z]/', $itemId)) { Notification::make() ->title('Invalid QR Format') - ->body('Expected format: plantcode/itemcode/yearmm/serialnumber') + ->body("Expected format: plantcode/itemcode/yearmm/serialnumber : Format Received : $itemId") ->danger() ->send(); $this->form->fill([ @@ -358,10 +358,11 @@ class PanelBoxInspectionStock extends Page return; } } - else { + else + { Notification::make() ->title('Invalid QR Format') - ->body('Expected format: plantcode/itemcode/yearmm/serialnumber (Or) plantcode/panelboxcode/serialnumber') + ->body('Expected format: plantcode/itemcode/yearmm/serialnumber') ->danger() ->send(); $this->form->fill([