Updated validation on resource file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 3m6s
Laravel Larastan / larastan (pull_request) Failing after 3m36s

This commit is contained in:
dhanabalan
2026-03-09 23:47:38 +05:30
parent dd84356591
commit ac9d9cec8d

View File

@@ -143,6 +143,8 @@ class ClassCharacteristicResource extends Resource
Forms\Components\TextInput::make('gamng')
->label('GAMNG')
->reactive()
->numeric()
->minValue(1.000)
->readOnly(fn (callable $get) => (! $get('arbid')))
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
@@ -151,6 +153,9 @@ class ClassCharacteristicResource extends Resource
Forms\Components\TextInput::make('lmnga')
->label('LMNGA')
->reactive()
->integer()
->minValue(1)
->maxValue(fn (callable $get) => ($get('gamng') ?? 1))
->readOnly(fn (callable $get) => (! $get('gamng')))
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
@@ -273,7 +278,8 @@ class ClassCharacteristicResource extends Resource
->readOnly(fn (callable $get) => (! $get('aufnr') || ! $get('gernr')))
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->required(),
Forms\Components\TextInput::make('zmm_head_max')
->label('ZMM HEAD MAX')
->reactive()
@@ -1048,8 +1054,37 @@ class ClassCharacteristicResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('motor_pump_pumpset_status')
Forms\Components\Select::make('motor_pump_pumpset_status')
->label('MOTOR PUMP PUMPSET STATUS')
// ->label('Search by PUMPSET Type')
->nullable()
->searchable()
->options(function (callable $get) {
$plantId = $get('plant_id');
$machineId = $get('machine_id');
$itemId = $get('item_id');
if (empty($plantId) || empty($machineId) || empty($itemId)) {
return [];
}
if (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true)) {
return [
'1' => 'Motor',
'2' => 'Pump',
'3' => 'Pump Set',
'4' => 'Name Plate',
];
} elseif (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) {
return [
'1' => 'Motor',
'2' => 'Pump',
'3' => 'Pump Set',
];
} else {
return [];
}
})
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);