Refactor form schema in StickerMasterResource for improved clarity and organization
This commit is contained in:
@@ -3,12 +3,12 @@
|
|||||||
namespace App\Filament\Resources;
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
use App\Filament\Exports\StickerMasterExporter;
|
use App\Filament\Exports\StickerMasterExporter;
|
||||||
use App\Filament\Imports\ShiftImporter;
|
//use App\Filament\Imports\ShiftImporter;
|
||||||
use App\Filament\Imports\StickerMasterImporter;
|
use App\Filament\Imports\StickerMasterImporter;
|
||||||
use App\Filament\Resources\StickerMasterResource\Pages;
|
use App\Filament\Resources\StickerMasterResource\Pages;
|
||||||
use App\Filament\Resources\StickerMasterResource\RelationManagers;
|
//use App\Filament\Resources\StickerMasterResource\RelationManagers;
|
||||||
use App\Models\StickerMaster;
|
use App\Models\StickerMaster;
|
||||||
use Closure;
|
//use Closure;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
@@ -99,7 +99,6 @@ 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');
|
$plantId = $get('plant_id');
|
||||||
$itemId = $get('item_id');
|
$itemId = $get('item_id');
|
||||||
|
|
||||||
@@ -176,24 +175,31 @@ class StickerMasterResource extends Resource
|
|||||||
->readOnly(true),
|
->readOnly(true),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation1')
|
Forms\Components\TextInput::make('part_validation1')
|
||||||
|
->label('Part Validation 1')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation2')
|
Forms\Components\TextInput::make('part_validation2')
|
||||||
|
->label('Part Validation 2')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation3')
|
Forms\Components\TextInput::make('part_validation3')
|
||||||
|
->label('Part Validation 3')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation4')
|
Forms\Components\TextInput::make('part_validation4')
|
||||||
|
->label('Part Validation 4')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('part_validation5')
|
Forms\Components\TextInput::make('part_validation5')
|
||||||
|
->label('Part Validation 5 (Capacitor QR)')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('laser_part_validation1')
|
Forms\Components\TextInput::make('laser_part_validation1')
|
||||||
|
->label('Laser Part Validation 1')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('laser_part_validation2')
|
Forms\Components\TextInput::make('laser_part_validation2')
|
||||||
|
->label('Laser Part Validation 1')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
Forms\Components\TextInput::make('panel_box_code')
|
Forms\Components\TextInput::make('panel_box_code')
|
||||||
@@ -210,7 +216,6 @@ class StickerMasterResource extends Resource
|
|||||||
->integer()
|
->integer()
|
||||||
->nullable(),
|
->nullable(),
|
||||||
|
|
||||||
|
|
||||||
Forms\Components\Select::make('material_type')
|
Forms\Components\Select::make('material_type')
|
||||||
->label('Material Type')
|
->label('Material Type')
|
||||||
->options([
|
->options([
|
||||||
@@ -425,7 +430,6 @@ class StickerMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('id')
|
Forms\Components\TextInput::make('id')
|
||||||
->hidden()
|
->hidden()
|
||||||
->readOnly(),
|
->readOnly(),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user