Forms\Components\Select::make('placeName')
->label('Place Name')
->required()
->live()
->searchable()
->options(Place::all()->pluck('placeName'))
->afterStateUpdated(function ($state, callable $set, callable $get){
$place = $get('placeName');
$placePrice = Place::find($place)->placePrice;
$placeOptions = Place::find($place)?->options->pluck('option');
$set('totalPrice', $placePrice);
$set('options', $placeOptions);
})
Forms\Components\Select::make('placeName')
->label('Place Name')
->required()
->live()
->searchable()
->options(Place::all()->pluck('placeName'))
->afterStateUpdated(function ($state, callable $set, callable $get){
$place = $get('placeName');
$placePrice = Place::find($place)->placePrice;
$placeOptions = Place::find($place)?->options->pluck('option');
$set('totalPrice', $placePrice);
$set('options', $placeOptions);
})