From 1db5e62e2141f3e574f1bedabac14ff89b03280a Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 20 Oct 2026 09:52:43 +0530 Subject: [PATCH 1/3] Added feed address column in plants table --- ...5125_add_feed_address_column_to_plants.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 database/migrations/2026_10_17_115125_add_feed_address_column_to_plants.php diff --git a/database/migrations/2026_10_17_115125_add_feed_address_column_to_plants.php b/database/migrations/2026_10_17_115125_add_feed_address_column_to_plants.php new file mode 100644 index 00000000..b1dd1749 --- /dev/null +++ b/database/migrations/2026_10_17_115125_add_feed_address_column_to_plants.php @@ -0,0 +1,31 @@ + Date: Tue, 20 Oct 2026 09:54:05 +0530 Subject: [PATCH 2/3] Added feed address in plant model file --- app/Models/Plant.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Models/Plant.php b/app/Models/Plant.php index 3a952c51..b094a71b 100644 --- a/app/Models/Plant.php +++ b/app/Models/Plant.php @@ -18,6 +18,7 @@ class Plant extends Model 'address', 'warehouse_number', 'reg_address', + 'feed_address', ]; public function company(): BelongsTo @@ -195,10 +196,10 @@ class Plant extends Model return $this->hasMany(TempStopCharacteristic::class, 'plant_id', 'id'); } - // public function laserAxisPositionMasters() - // { - // return $this->hasMany(LaserAxisPositionMaster::class, 'plant_id', 'id'); - // } + public function laserAxisPositionMasters() + { + return $this->hasMany(LaserAxisPositionMaster::class, 'plant_id', 'id'); + } public function users() { -- 2.49.1 From 9015095ecce358aaca02cf1bb916961a64fb9974 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 20 Oct 2026 09:56:16 +0530 Subject: [PATCH 3/3] Added feed back column in plant resource --- app/Filament/Resources/PlantResource.php | 33 +++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/app/Filament/Resources/PlantResource.php b/app/Filament/Resources/PlantResource.php index 141ea44d..ef54fb96 100644 --- a/app/Filament/Resources/PlantResource.php +++ b/app/Filament/Resources/PlantResource.php @@ -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() -- 2.49.1