->options(function ($state, callable $set, callable $get) { $place = Place::find($get('placeName')); if ($place) { $placeOptions = $place->options; if ($placeOptions) { $getPlaceOptions = collect($placeOptions)->pluck('option'); return $getPlaceOptions; } } return null; })
Forms\Components\TextInput::make('placeID') ->label('Place ID') ->required() ->maxLength(50) ->live() ->afterStateUpdated(function ($state, callable $set, callable $get){ $place = $get('placeID'); $placeName = Place::find($place)->placeName; $placePrice = Place::find($place)->placePrice; $options = Place::find($place)->options; $option = $options->options($state['option']); $set('placeName', $placeName); $set('totalPrice', $placePrice); $set('options', $options); }), Forms\Components\TextInput::make('placeName') ->label('Place Name') ->disabled() ->dehydrated(false), Forms\Components\Select::make('options') ->label('Options'),’m