ranjith-dev #1287
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user