diff --git a/app/Filament/Resources/VisitorEntryResource.php b/app/Filament/Resources/VisitorEntryResource.php index 4aeff6ab..2d00fa25 100644 --- a/app/Filament/Resources/VisitorEntryResource.php +++ b/app/Filament/Resources/VisitorEntryResource.php @@ -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')