Added feed back column in plant resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 1m7s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m15s
Laravel Pint / pint (pull_request) Successful in 3m3s
Laravel Larastan / larastan (pull_request) Failing after 5m56s

This commit is contained in:
dhanabalan
2026-10-20 09:56:16 +05:30
parent 43c474bb59
commit 9015095ecc

View File

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