Loading foreign key value while update
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Filament\Resources\BlockResource\Pages;
|
|||||||
use App\Models\Block;
|
use App\Models\Block;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
@@ -58,6 +59,7 @@ class BlockResource extends Resource
|
|||||||
// ->unique(ignoreRecord: true)
|
// ->unique(ignoreRecord: true)
|
||||||
->required()
|
->required()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$nameId = $get('plant_id');
|
$nameId = $get('plant_id');
|
||||||
// Ensure `linestop_id` is not cleared
|
// Ensure `linestop_id` is not cleared
|
||||||
@@ -75,6 +77,9 @@ class BlockResource extends Resource
|
|||||||
])
|
])
|
||||||
->hint(fn ($get) => $get('bPlantError') ? $get('bPlantError') : null)
|
->hint(fn ($get) => $get('bPlantError') ? $get('bPlantError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->hidden()
|
||||||
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(2),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Filament\Resources\ItemResource\Pages;
|
|||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ExportAction;
|
use Filament\Tables\Actions\ExportAction;
|
||||||
@@ -38,6 +39,7 @@ class ItemResource extends Resource
|
|||||||
->required()
|
->required()
|
||||||
// ->nullable(),
|
// ->nullable(),
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
@@ -64,6 +66,7 @@ class ItemResource extends Resource
|
|||||||
->minLength(6)
|
->minLength(6)
|
||||||
// ->autocapitalize('characters')
|
// ->autocapitalize('characters')
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$code = $get('code');
|
$code = $get('code');
|
||||||
// Ensure `linestop_id` is not cleared
|
// Ensure `linestop_id` is not cleared
|
||||||
@@ -123,6 +126,9 @@ class ItemResource extends Resource
|
|||||||
->required()
|
->required()
|
||||||
->placeholder('Scan the valid description'),
|
->placeholder('Scan the valid description'),
|
||||||
// ->columnSpanFull(),
|
// ->columnSpanFull(),
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->hidden()
|
||||||
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(2),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Filament\Resources\LineResource\RelationManagers;
|
|||||||
use App\Models\Line;
|
use App\Models\Line;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
@@ -33,97 +34,101 @@ class LineResource extends Resource
|
|||||||
Section::make('')
|
Section::make('')
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->required()
|
->required()
|
||||||
// ->nullable(),
|
// ->nullable(),
|
||||||
->reactive()
|
->reactive()
|
||||||
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
||||||
$plantId = $get('plant_id');
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
// Ensure `linestop_id` is not cleared
|
$plantId = $get('plant_id');
|
||||||
if (!$plantId) {
|
// Ensure `linestop_id` is not cleared
|
||||||
$set('lPlantError', 'Please select a plant first.');
|
if (!$plantId) {
|
||||||
return;
|
$set('lPlantError', 'Please select a plant first.');
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$set('lPlantError', null);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('lPlantError') ? 'border-red-500' : '',
|
|
||||||
])
|
|
||||||
->hint(fn ($get) => $get('lPlantError') ? $get('lPlantError') : null)
|
|
||||||
->hintColor('danger'),
|
|
||||||
Forms\Components\TextInput::make('name')
|
|
||||||
->required()
|
|
||||||
->placeholder('Scan the valid name')
|
|
||||||
// ->unique(
|
|
||||||
// ignoreRecord: true,
|
|
||||||
// modifyRuleUsing: function (Unique $rule) {
|
|
||||||
// return $rule->where('plant_id', $this->data['plant_id']);
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// ->rule(function () {
|
|
||||||
// return function ($attribute, $value, $fail) {
|
|
||||||
// $exists = Line::where('name', $value)
|
|
||||||
// ->where('plant_id', request()->input('plant_id'))
|
|
||||||
// ->exists();
|
|
||||||
|
|
||||||
// if ($exists) {
|
|
||||||
// $fail('The combination of name and plant ID must be unique.');
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// })
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$lineNam = $get('name');
|
|
||||||
// Ensure `linestop_id` is not cleared
|
|
||||||
if (!$lineNam) {
|
|
||||||
$set('lNameError', 'Scan the valid name.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$exists = Line::where('name', $lineNam)
|
|
||||||
->where('plant_id', $get('plant_id'))
|
|
||||||
->exists();
|
|
||||||
|
|
||||||
if ($exists) {
|
|
||||||
$set('name', null);
|
|
||||||
$set('lNameError', 'The name has already been taken.');
|
|
||||||
// $set('lNameError', 'The combination of name and plant ID must be unique.');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$set('lNameError', null);
|
else
|
||||||
}
|
{
|
||||||
})
|
$set('lPlantError', null);
|
||||||
->extraAttributes(fn ($get) => [
|
}
|
||||||
'class' => $get('lNameError') ? 'border-red-500' : '',
|
})
|
||||||
])
|
->extraAttributes(fn ($get) => [
|
||||||
->hint(fn ($get) => $get('lNameError') ? $get('lNameError') : null)
|
'class' => $get('lPlantError') ? 'border-red-500' : '',
|
||||||
->hintColor('danger'),
|
])
|
||||||
Forms\Components\TextInput::make('type')
|
->hint(fn ($get) => $get('lPlantError') ? $get('lPlantError') : null)
|
||||||
->required()
|
->hintColor('danger'),
|
||||||
->placeholder('Scan the valid type')
|
Forms\Components\TextInput::make('name')
|
||||||
->reactive()
|
->required()
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->placeholder('Scan the valid name')
|
||||||
$lineTyp = $get('type');
|
// ->unique(
|
||||||
// Ensure `linestop_id` is not cleared
|
// ignoreRecord: true,
|
||||||
if (!$lineTyp) {
|
// modifyRuleUsing: function (Unique $rule) {
|
||||||
$set('lTypeError', 'Scan the valid type.');
|
// return $rule->where('plant_id', $this->data['plant_id']);
|
||||||
return;
|
// }
|
||||||
}
|
// )
|
||||||
else
|
// ->rule(function () {
|
||||||
{
|
// return function ($attribute, $value, $fail) {
|
||||||
$set('lTypeError', null);
|
// $exists = Line::where('name', $value)
|
||||||
}
|
// ->where('plant_id', request()->input('plant_id'))
|
||||||
})
|
// ->exists();
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('lTypeError') ? 'border-red-500' : '',
|
// if ($exists) {
|
||||||
])
|
// $fail('The combination of name and plant ID must be unique.');
|
||||||
->hint(fn ($get) => $get('lTypeError') ? $get('lTypeError') : null)
|
// }
|
||||||
->hintColor('danger'),
|
// };
|
||||||
|
// })
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$lineNam = $get('name');
|
||||||
|
// Ensure `linestop_id` is not cleared
|
||||||
|
if (!$lineNam) {
|
||||||
|
$set('lNameError', 'Scan the valid name.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$exists = Line::where('name', $lineNam)
|
||||||
|
->where('plant_id', $get('plant_id'))
|
||||||
|
->exists();
|
||||||
|
|
||||||
|
if ($exists) {
|
||||||
|
$set('name', null);
|
||||||
|
$set('lNameError', 'The name has already been taken.');
|
||||||
|
// $set('lNameError', 'The combination of name and plant ID must be unique.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$set('lNameError', null);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('lNameError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('lNameError') ? $get('lNameError') : null)
|
||||||
|
->hintColor('danger'),
|
||||||
|
Forms\Components\TextInput::make('type')
|
||||||
|
->required()
|
||||||
|
->placeholder('Scan the valid type')
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$lineTyp = $get('type');
|
||||||
|
// Ensure `linestop_id` is not cleared
|
||||||
|
if (!$lineTyp) {
|
||||||
|
$set('lTypeError', 'Scan the valid type.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$set('lTypeError', null);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('lTypeError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('lTypeError') ? $get('lTypeError') : null)
|
||||||
|
->hintColor('danger'),
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->hidden()
|
||||||
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(2),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Models\Plant;
|
|||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\Section;
|
use Filament\Forms\Components\Section;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
@@ -69,6 +70,7 @@ class PlantResource extends Resource
|
|||||||
->relationship('company', 'name')
|
->relationship('company', 'name')
|
||||||
->required()
|
->required()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$companyId = $get('company_id');
|
$companyId = $get('company_id');
|
||||||
// Ensure `linestop_id` is not cleared
|
// Ensure `linestop_id` is not cleared
|
||||||
@@ -132,6 +134,9 @@ 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\TextInput::make('id')
|
||||||
|
->hidden()
|
||||||
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(2),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Models\Shift;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
@@ -37,6 +38,7 @@ class ShiftResource extends Resource
|
|||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
// ->nullable()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
// ->afterStateUpdated(fn ($set) => $set('block_id', null) & $set('name', null) & $set('start_time', null) & $set('duration', null) & $set('end_time', null))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
@@ -60,6 +62,7 @@ class ShiftResource extends Resource
|
|||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
// ->nullable()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
// ->options(fn (callable $get) =>
|
// ->options(fn (callable $get) =>
|
||||||
// \App\Models\Block::where('plant_id', $get('plant_id'))
|
// \App\Models\Block::where('plant_id', $get('plant_id'))
|
||||||
// ->pluck('name', 'id')
|
// ->pluck('name', 'id')
|
||||||
@@ -203,6 +206,9 @@ class ShiftResource extends Resource
|
|||||||
])
|
])
|
||||||
->hint(fn ($get) => $get('sEndTimeError') ? $get('sEndTimeError') : null)
|
->hint(fn ($get) => $get('sEndTimeError') ? $get('sEndTimeError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->hidden()
|
||||||
|
->readOnly(),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(2),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class StickerMasterResource extends Resource
|
|||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->reactive()
|
->reactive()
|
||||||
->nullable()
|
->nullable()
|
||||||
->disabled(fn (Get $get) => !empty($get('id')))
|
->disabled(fn (Get $get) => !empty($get('id'))) //disable in edit if user try to change
|
||||||
->afterStateUpdated(fn (callable $set) =>
|
->afterStateUpdated(fn (callable $set) =>
|
||||||
$set('item_id', null) & $set('item_description', null)
|
$set('item_id', null) & $set('item_description', null)
|
||||||
)
|
)
|
||||||
@@ -56,8 +56,8 @@ class StickerMasterResource extends Resource
|
|||||||
->disabled(fn (Get $get) => !empty($get('id')))
|
->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
->live(debounce: 500) // Enable live updates
|
->live(debounce: 500) // Enable live updates
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$plantId = $get('plant_id'); // Get selected plant_id
|
$plantId = $get('plant_id');
|
||||||
$itemId = $get('item_id'); // Get entered item_id
|
$itemId = $get('item_id');
|
||||||
|
|
||||||
// Ensure `item_id` is not cleared
|
// Ensure `item_id` is not cleared
|
||||||
if (!$plantId || !$itemId) {
|
if (!$plantId || !$itemId) {
|
||||||
@@ -77,115 +77,83 @@ class StickerMasterResource extends Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
// ->validationAttribute('Item Code')
|
|
||||||
// ->rule('required')
|
|
||||||
// ->extraAttributes(fn ($get) => [
|
|
||||||
// 'class' => $get('validationError') ? 'border-red-500' : '',
|
|
||||||
// ])
|
|
||||||
// ->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
|
||||||
// ->hintColor('danger'), // Show error in red under the input field
|
|
||||||
|
|
||||||
Forms\Components\TextInput::make('item_description')
|
Forms\Components\TextInput::make('item_description')
|
||||||
->label('Description')
|
->label('Description')
|
||||||
->required()
|
->required()
|
||||||
->reactive()
|
->reactive()
|
||||||
->readOnly(true),
|
->readOnly(true),
|
||||||
|
|
||||||
//Forms\Components\Textarea::make('serial_number_motor'),
|
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation1')
|
Forms\Components\TextInput::make('part_validation1')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation2')
|
Forms\Components\TextInput::make('part_validation2')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation3')
|
Forms\Components\TextInput::make('part_validation3')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation4')
|
Forms\Components\TextInput::make('part_validation4')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation5')
|
Forms\Components\TextInput::make('part_validation5')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('serial_number_motor')
|
Forms\Components\Checkbox::make('serial_number_motor')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\Textarea::make('serial_number_pump')
|
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('serial_number_pump')
|
Forms\Components\Checkbox::make('serial_number_pump')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('serial_number_pumpset'),
|
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('serial_number_pumpset')
|
Forms\Components\Checkbox::make('serial_number_pumpset')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('pack_slip_motor'),
|
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('pack_slip_motor')
|
Forms\Components\Checkbox::make('pack_slip_motor')
|
||||||
->nullable()
|
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('pack_slip_pump'),
|
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('pack_slip_pump')
|
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('pack_slip_pumpset'),
|
Forms\Components\Checkbox::make('pack_slip_pump')
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('pack_slip_pumpset')
|
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('name_plate_motor'),
|
Forms\Components\Checkbox::make('pack_slip_pumpset')
|
||||||
|
->nullable()
|
||||||
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('name_plate_motor')
|
Forms\Components\Checkbox::make('name_plate_motor')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('name_plate_pump'),
|
Forms\Components\Checkbox::make('name_plate_pump')
|
||||||
|
->nullable()
|
||||||
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('name_plate_pump')
|
Forms\Components\Checkbox::make('name_plate_pumpset')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('name_plate_pumpset'),
|
Forms\Components\Checkbox::make('tube_sticker_motor')
|
||||||
|
->nullable()
|
||||||
Forms\Components\Checkbox::make('name_plate_pumpset')
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
->nullable()
|
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('tube_sticker_motor'),
|
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('tube_sticker_motor')
|
|
||||||
->nullable()
|
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('tube_sticker_pump'),
|
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('tube_sticker_pump')
|
Forms\Components\Checkbox::make('tube_sticker_pump')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('tube_sticker_pumpset'),
|
Forms\Components\Checkbox::make('tube_sticker_pumpset')
|
||||||
|
->nullable()
|
||||||
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null), //to pass null value
|
||||||
|
|
||||||
Forms\Components\Checkbox::make('tube_sticker_pumpset')
|
Forms\Components\Checkbox::make('warranty_card')
|
||||||
->nullable()
|
->nullable()
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
||||||
|
|
||||||
//Forms\Components\TextInput::make('warranty_card'),
|
Forms\Components\TextInput::make('id')
|
||||||
|
->hidden()
|
||||||
Forms\Components\Checkbox::make('warranty_card')
|
->readOnly(),
|
||||||
->nullable()
|
|
||||||
->dehydrateStateUsing(fn ($state) => $state ? $state : null),
|
|
||||||
Forms\Components\TextInput::make('id')
|
|
||||||
->hidden()
|
|
||||||
->readOnly(),
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -196,74 +164,74 @@ class StickerMasterResource extends Resource
|
|||||||
->searchable()
|
->searchable()
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('id')
|
Tables\Columns\TextColumn::make('id')
|
||||||
->label('ID')
|
->label('ID')
|
||||||
->numeric()
|
->numeric()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('item.code')
|
Tables\Columns\TextColumn::make('item.code')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('serial_number_motor')
|
Tables\Columns\CheckboxColumn::make('serial_number_motor')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('serial_number_pump')
|
Tables\Columns\CheckboxColumn::make('serial_number_pump')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('serial_number_pumpset')
|
Tables\Columns\CheckboxColumn::make('serial_number_pumpset')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('pack_slip_motor')
|
Tables\Columns\CheckboxColumn::make('pack_slip_motor')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('pack_slip_pump')
|
Tables\Columns\CheckboxColumn::make('pack_slip_pump')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('pack_slip_pumpset')
|
Tables\Columns\CheckboxColumn::make('pack_slip_pumpset')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('name_plate_motor')
|
Tables\Columns\CheckboxColumn::make('name_plate_motor')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('name_plate_pump')
|
Tables\Columns\CheckboxColumn::make('name_plate_pump')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('name_plate_pumpset')
|
Tables\Columns\CheckboxColumn::make('name_plate_pumpset')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('tube_sticker_motor')
|
Tables\Columns\CheckboxColumn::make('tube_sticker_motor')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('tube_sticker_pump')
|
Tables\Columns\CheckboxColumn::make('tube_sticker_pump')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('tube_sticker_pumpset')
|
Tables\Columns\CheckboxColumn::make('tube_sticker_pumpset')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\CheckboxColumn::make('warranty_card')
|
Tables\Columns\CheckboxColumn::make('warranty_card')
|
||||||
->disabled(true)
|
->disabled(true)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('part_validation1')
|
Tables\Columns\TextColumn::make('part_validation1')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('part_validation2')
|
Tables\Columns\TextColumn::make('part_validation2')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('part_validation3')
|
Tables\Columns\TextColumn::make('part_validation3')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('part_validation4')
|
Tables\Columns\TextColumn::make('part_validation4')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('part_validation5')
|
Tables\Columns\TextColumn::make('part_validation5')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
Tables\Columns\TextColumn::make('updated_at')
|
Tables\Columns\TextColumn::make('updated_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
Tables\Columns\TextColumn::make('deleted_at')
|
Tables\Columns\TextColumn::make('deleted_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
Tables\Filters\TrashedFilter::make(),
|
Tables\Filters\TrashedFilter::make(),
|
||||||
|
|||||||
Reference in New Issue
Block a user