Prefill field

Hey guys, I have a dependent field that needs to be prefilled based on a select, If you check the attached image, it only works with the placeholder option, but when try to use default it doesn't fill the field, what am I doing wrong?
Select::make('variations')
->required()
->translateLabel()
->reactive()
->options(function (callable $get) {
$services = Variation::where('service_id', $get('service_id'))->pluck('name', 'price');
if ($services) {
return $services->toArray();
}
})
->preload()
->searchable(),
TextInput::make('price')
->placeholder(fn (callable $get) => $get('variations'))
->default(fn (callable $get) => $get('variations'))
->default(fn (Get $get) => $get('variations'))
Select::make('variations')
->required()
->translateLabel()
->reactive()
->options(function (callable $get) {
$services = Variation::where('service_id', $get('service_id'))->pluck('name', 'price');
if ($services) {
return $services->toArray();
}
})
->preload()
->searchable(),
TextInput::make('price')
->placeholder(fn (callable $get) => $get('variations'))
->default(fn (callable $get) => $get('variations'))
->default(fn (Get $get) => $get('variations'))
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server