loaded options in tools and gadgets in visitor entry resource page #1329
@@ -350,8 +350,26 @@ class VisitorEntryResource extends Resource
|
||||
])
|
||||
->reactive()
|
||||
->placeholder('Select Mode of Travel'),
|
||||
Forms\Components\TextInput::make('tool_gadget')
|
||||
->label('Tools & Gadgets'),
|
||||
Forms\Components\Select::make('tool_gadget')
|
||||
->label('Tools & Gadgets')
|
||||
->reactive()
|
||||
->options([
|
||||
'Laptop' => 'Laptop',
|
||||
'Tablets' => 'Tablets',
|
||||
'Mobiles' => 'Mobiles',
|
||||
'Others' => 'Others',
|
||||
])
|
||||
->dehydrateStateUsing(function ($state, callable $get) {
|
||||
return $state == 'Others'
|
||||
? $get('other_tool')
|
||||
: $state;
|
||||
}),
|
||||
Forms\Components\TextInput::make('other_tool')
|
||||
->label('Specify Tool Type')
|
||||
->reactive()
|
||||
->visible(fn (callable $get) => $get('tool_gadget') == 'Others')
|
||||
->required(fn (callable $get) => $get('tool_gadget') == 'Others')
|
||||
->dehydrated(false),
|
||||
Forms\Components\TextInput::make('serial_number')
|
||||
->label('Serial Number'),
|
||||
Forms\Components\DateTimePicker::make('in_time')
|
||||
|
||||
Reference in New Issue
Block a user