From 8c101fdec5be811d12584e95338c1efaf65bacbe Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 16 Oct 2026 16:42:53 +0530 Subject: [PATCH 1/4] Added regd address column in plants table --- ...63701_add_reg_address_column_to_plants.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 database/migrations/2026_10_16_163701_add_reg_address_column_to_plants.php diff --git a/database/migrations/2026_10_16_163701_add_reg_address_column_to_plants.php b/database/migrations/2026_10_16_163701_add_reg_address_column_to_plants.php new file mode 100644 index 00000000..4fc1a7d0 --- /dev/null +++ b/database/migrations/2026_10_16_163701_add_reg_address_column_to_plants.php @@ -0,0 +1,31 @@ + Date: Fri, 16 Oct 2026 16:43:23 +0530 Subject: [PATCH 2/4] Added reg address in plant model file --- app/Models/Plant.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Models/Plant.php b/app/Models/Plant.php index f3fcedfb..82eaca88 100644 --- a/app/Models/Plant.php +++ b/app/Models/Plant.php @@ -17,6 +17,7 @@ class Plant extends Model 'name', 'address', 'warehouse_number', + 'reg_address', ]; public function company(): BelongsTo @@ -194,6 +195,11 @@ 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 users() { return $this->hasMany(User::class, 'plant_id', 'id'); @@ -249,4 +255,8 @@ class Plant extends Model return $this->hasMany(StickerOrder::class, 'plant_id', 'id'); } + public function ItemCharacteristics() + { + return $this->hasMany(ItemCharacteristic::class, 'plant_id', 'id'); + } } From bfcf9970fc2fdafe409c69c57f87e1761b094d94 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 16 Oct 2026 16:44:31 +0530 Subject: [PATCH 3/4] Added reg address in plant resorce page --- app/Filament/Resources/PlantResource.php | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/Filament/Resources/PlantResource.php b/app/Filament/Resources/PlantResource.php index 5bb04417..141ea44d 100644 --- a/app/Filament/Resources/PlantResource.php +++ b/app/Filament/Resources/PlantResource.php @@ -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() From 5fcc485ecfb31687e3e6230dccd48f75a9d58ee0 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 16 Oct 2026 16:46:16 +0530 Subject: [PATCH 4/4] commented laser axis position master in plant model file --- app/Models/Plant.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/Plant.php b/app/Models/Plant.php index 82eaca88..3a952c51 100644 --- a/app/Models/Plant.php +++ b/app/Models/Plant.php @@ -195,10 +195,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() {