Added ware house number to all plant related files
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled

This commit is contained in:
dhanabalan
2026-05-08 15:06:33 +05:30
parent e27871d0c0
commit a230208718
5 changed files with 83 additions and 16 deletions

View File

@@ -38,6 +38,7 @@ class PlantResource extends Resource
Section::make('')
->schema([
Forms\Components\TextInput::make('code')
->label('Code')
->required()
->unique(ignoreRecord: true)
->integer()
@@ -78,7 +79,8 @@ class PlantResource extends Resource
->hint(fn ($get) => $get('pCodeError') ? $get('pCodeError') : null)
->hintColor('danger'),
Forms\Components\Select::make('company_id')
// ->placeholder('Choose the valid company name')
->label('Company')
->placeholder('Choose the valid company nany')
->relationship('company', 'name')
->required()
->reactive()
@@ -104,9 +106,10 @@ class PlantResource extends Resource
->hintColor('danger'),
Forms\Components\TextInput::make('name')
->required()
->label('Name')
->placeholder('Scan the valid name')
->unique(ignoreRecord: true)
->columnSpanFull()
// ->columnSpanFull()
->reactive()
->minLength(5)
->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -128,8 +131,38 @@ class PlantResource extends Resource
])
->hint(fn ($get) => $get('pNameError') ? $get('pNameError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('warehouse_number')
->required()
->label('Warehouse Number')
->placeholder('Scan the valid warehouse number')
->unique(ignoreRecord: true)
->reactive()
->numeric()
->length(3),
// ->afterStateUpdated(function ($state, callable $set, callable $get) {
// $codeId = $get('warehouse_number');
// // Ensure `linestop_id` is not cleared
// if (! $codeId) {
// $set('wNumberError', 'Scan the valid warehouse number.');
// return;
// } else {
// if (strlen($codeId) != 3) {
// $set('wNumberError', 'Warehouse number must be exactly 3 digits!');
// return;
// }
// $set('wNumberError', null);
// }
// })
// ->extraAttributes(fn ($get) => [
// 'class' => $get('wNumberError') ? 'border-red-500' : '',
// ])
// ->hint(fn ($get) => $get('wNumberError') ? $get('wNumberError') : null)
// ->hintColor('danger'),
Forms\Components\Textarea::make('address')
->required()
->label('Address')
->placeholder('Scan the valid address')
->unique(ignoreRecord: true)
->columnSpanFull()
@@ -190,6 +223,11 @@ class PlantResource extends Resource
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('warehouse_number')
->label('Warehouse Number')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('address')
->label('Address')
->alignCenter()