From c4b4993e1debacafbaeb29f77d16a403512abec5 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 2 Jul 2025 16:05:25 +0530 Subject: [PATCH] Updated readonly rule --- app/Filament/Pages/LocatorValidation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Filament/Pages/LocatorValidation.php b/app/Filament/Pages/LocatorValidation.php index 0347698..c75096c 100644 --- a/app/Filament/Pages/LocatorValidation.php +++ b/app/Filament/Pages/LocatorValidation.php @@ -72,14 +72,14 @@ class LocatorValidation extends Page implements HasForms ->label('Scan Pallet No') ->reactive() // ->readonly(fn () => $this->disablePalletNo) - ->readOnly(fn (callable $get) => !empty($get('scan_serial_no')) || !empty($get('scan_locator_no'))) + ->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_serial_no')) || !empty($get('scan_locator_no'))) ->extraAttributes([ 'wire:keydown.enter' => 'processPalletNo($event.target.value)', ]), TextInput::make('scan_serial_no') ->label('Scan Serial No') // ->readOnly(fn () => $this->disableSerialNo) - ->readOnly(fn (callable $get) => !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no'))) + ->readOnly(fn (callable $get) => !$get('plant_id') || !empty($get('scan_pallet_no')) || !empty($get('scan_locator_no'))) ->reactive() ->extraAttributes([ 'wire:keydown.enter' => 'processSerialNo($event.target.value)', @@ -87,7 +87,7 @@ class LocatorValidation extends Page implements HasForms TextInput::make('scan_locator_no') ->label('Scan Locator No') ->reactive() - // ->readOnly(fn ($get) => filled($get('scan_locator_no'))) + ->readOnly(fn (callable $get) => !$get('plant_id') || (!$get('scan_pallet_no') && !$get('scan_serial_no'))) ->extraAttributes([ 'id' => 'scan_locator_no', 'wire:keydown.enter' => 'processLocatorNo($event.target.value)',