Merge pull request 'ranjith-dev' (#1287) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s

Reviewed-on: #1287
This commit was merged in pull request #1287.
This commit is contained in:
2026-10-21 05:42:05 +00:00
3 changed files with 64 additions and 4 deletions

View File

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

View File

@@ -19,6 +19,7 @@ class Plant extends Model
'warehouse_number',
'reg_address',
'feed_address',
'tollfree',
];
public function company(): BelongsTo
@@ -196,10 +197,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()
{

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE plants
ADD COLUMN tollfree TEXT DEFAULT NULL
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('plants', function (Blueprint $table) {
// //
// });
}
};