From d676e31091b15ade6f701174302250bd4ecfdf1b Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 17 Sep 2026 16:01:14 +0530 Subject: [PATCH] Added serila number length check validation in panel box validation page --- .../Resources/PanelBoxValidationResource.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Filament/Resources/PanelBoxValidationResource.php b/app/Filament/Resources/PanelBoxValidationResource.php index ad3c4fa..05d5ed5 100644 --- a/app/Filament/Resources/PanelBoxValidationResource.php +++ b/app/Filament/Resources/PanelBoxValidationResource.php @@ -38,7 +38,7 @@ class PanelBoxValidationResource extends Resource { protected static ?string $model = PanelBoxValidation::class; - protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-check'; protected static ?string $navigationGroup = 'Panel Box'; @@ -581,6 +581,19 @@ class PanelBoxValidationResource extends Resource $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(); + + $set('item_id', null); + $set('serial_exists', false); + + return; + } + $existInMasterPo = PanelGrMaster::where('document_number', $pOrder)->where('plant_id', $plantId)->first(); if(!$existInMasterPo){