From f8e06965cf3231c86cdca9d8a554e9ec7c149630 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 28 Oct 2026 16:58:19 +0530 Subject: [PATCH] loaded options in tools and gadgets in visitor entry resource page --- .../Resources/VisitorEntryResource.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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')