statePath('filters') ->schema([ Section::make('') // You can give your section a title or leave it blank ->schema([ TextInput::make('scan_out_gate_pass') ->label('Scan Out Gate Pass') ->required() ->reactive() ->extraAttributes([ 'wire:keydown.enter' => 'processGatePass($event.target.value)', ]), ]) ->columns(5) ]); } public function processGatePass($gatePass) { $entry = VisitorEntry::where('register_id', $gatePass)->first(); if ($entry) { $entry->out_time = now(); $entry->save(); Notification::make() ->title('Gate Pass Processed') ->body('Gate pass has been successfully processed. Visitor marked as exited.') ->success() ->send(); $this->filters['scan_out_gate_pass'] = ''; } else { Notification::make() ->title('Invalid Gate Pass') ->body('The scanned gate pass is not valid. Please try again.') ->danger() ->send(); } } public static function canAccess(): bool { return Auth::check() && Auth::user()->can('view gate entry page'); } }