Merge pull request 'ranjith-dev' (#1273) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #1273
This commit was merged in pull request #1273.
This commit is contained in:
@@ -185,15 +185,14 @@ class PlantResource extends Resource
|
|||||||
->hint(fn ($get) => $get('pAddressError') ? $get('pAddressError') : null)
|
->hint(fn ($get) => $get('pAddressError') ? $get('pAddressError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
Forms\Components\Textarea::make('reg_address')
|
Forms\Components\Textarea::make('reg_address')
|
||||||
->required()
|
->label('Regd Address')
|
||||||
->label('Reg Address')
|
|
||||||
->placeholder('Scan the valid Regd address')
|
->placeholder('Scan the valid Regd address')
|
||||||
->unique(ignoreRecord: true)
|
->unique(ignoreRecord: true)
|
||||||
->columnSpanFull()
|
->columnSpanFull()
|
||||||
->reactive()
|
->reactive()
|
||||||
->minLength(5)
|
->minLength(5)
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$nameId = $get('address');
|
$nameId = $get('reg_address');
|
||||||
// Ensure `linestop_id` is not cleared
|
// Ensure `linestop_id` is not cleared
|
||||||
if (! $nameId) {
|
if (! $nameId) {
|
||||||
$set('pRegAddressError', 'Scan the valid reg address.');
|
$set('pRegAddressError', 'Scan the valid reg address.');
|
||||||
@@ -208,6 +207,29 @@ class PlantResource extends Resource
|
|||||||
])
|
])
|
||||||
->hint(fn ($get) => $get('pRegAddressError') ? $get('pRegAddressError') : null)
|
->hint(fn ($get) => $get('pRegAddressError') ? $get('pRegAddressError') : null)
|
||||||
->hintColor('danger'),
|
->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')
|
Forms\Components\TextInput::make('id')
|
||||||
->hidden()
|
->hidden()
|
||||||
->readOnly(),
|
->readOnly(),
|
||||||
@@ -262,6 +284,11 @@ class PlantResource extends Resource
|
|||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
Tables\Columns\TextColumn::make('feed_address')
|
||||||
|
->label('FeedBack')
|
||||||
|
->alignCenter()
|
||||||
|
->sortable()
|
||||||
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('company.name')
|
Tables\Columns\TextColumn::make('company.name')
|
||||||
->label('Company')
|
->label('Company')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class Plant extends Model
|
|||||||
'address',
|
'address',
|
||||||
'warehouse_number',
|
'warehouse_number',
|
||||||
'reg_address',
|
'reg_address',
|
||||||
|
'feed_address',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function company(): BelongsTo
|
public function company(): BelongsTo
|
||||||
@@ -195,10 +196,10 @@ class Plant extends Model
|
|||||||
return $this->hasMany(TempStopCharacteristic::class, 'plant_id', 'id');
|
return $this->hasMany(TempStopCharacteristic::class, 'plant_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function laserAxisPositionMasters()
|
public function laserAxisPositionMasters()
|
||||||
// {
|
{
|
||||||
// return $this->hasMany(LaserAxisPositionMaster::class, 'plant_id', 'id');
|
return $this->hasMany(LaserAxisPositionMaster::class, 'plant_id', 'id');
|
||||||
// }
|
}
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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 feed_address TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('plants', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user