From 52fa8fa616e2265ccab7945e69f2b0b6f3b91618 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 17 Sep 2026 15:45:32 +0530 Subject: [PATCH] Added string length check logic in panel box inspection --- app/Filament/Pages/PanelBoxInspectionStock.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Filament/Pages/PanelBoxInspectionStock.php b/app/Filament/Pages/PanelBoxInspectionStock.php index eb9130f..9f87d84 100644 --- a/app/Filament/Pages/PanelBoxInspectionStock.php +++ b/app/Filament/Pages/PanelBoxInspectionStock.php @@ -310,6 +310,22 @@ class PanelBoxInspectionStock extends Page $itemCode = $panelBoxCode; $serialNumber = $panelBoxSerialNo; + if (strlen($serialNumber) > 28) { + Notification::make() + ->title('Invalid Serial Number') + ->body("Serial number cannot be greater than 28 characters. Current length: " . strlen($panelBoxSerialNo)) + ->danger() + ->send(); + + $this->form->fill([ + 'plant_id' => $plantId, + 'line_id' => $lineId, + 'item_id' => null, + ]); + + return; + } + $iId = Item::where('code', $itemCode)->where('plant_id', $plantId)->first(); if(!$iId){