Added reg address in plant resorce page
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s

This commit is contained in:
dhanabalan
2026-10-16 16:44:31 +05:30
parent 419c2e8775
commit bfcf9970fc

View File

@@ -184,6 +184,30 @@ class PlantResource extends Resource
])
->hint(fn ($get) => $get('pAddressError') ? $get('pAddressError') : null)
->hintColor('danger'),
Forms\Components\Textarea::make('reg_address')
->required()
->label('Reg Address')
->placeholder('Scan the valid Regd address')
->unique(ignoreRecord: true)
->columnSpanFull()
->reactive()
->minLength(5)
->afterStateUpdated(function ($state, callable $set, callable $get) {
$nameId = $get('address');
// Ensure `linestop_id` is not cleared
if (! $nameId) {
$set('pRegAddressError', 'Scan the valid reg address.');
return;
} else {
$set('pRegAddressError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('pRegAddressError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('pRegAddressError') ? $get('pRegAddressError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('id')
->hidden()
->readOnly(),
@@ -233,6 +257,11 @@ class PlantResource extends Resource
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('reg_address')
->label('Regd Address')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('company.name')
->label('Company')
->alignCenter()