Suky
Suky
FFilament
Created by Suky on 4/9/2024 in #❓┊help
Dinamically update options based on another input
so the question is pretty straight forward, is there a way to update the options of a select field based on another field? so these options would be nice if I could add an where query
Forms\Components\Select::make('bundle_descriptor_id')
->label('Bundle Descriptor')
->searchable()
->relationship('descriptor', 'name')
->createOptionForm([
Forms\Components\TextInput::make('name')
->required(),
])
->options(function () {
return \App\Models\StreamingBundleDescriptor::all()->pluck('name', 'id')->toArray();
})
->required(),
Forms\Components\Select::make('bundle_descriptor_id')
->label('Bundle Descriptor')
->searchable()
->relationship('descriptor', 'name')
->createOptionForm([
Forms\Components\TextInput::make('name')
->required(),
])
->options(function () {
return \App\Models\StreamingBundleDescriptor::all()->pluck('name', 'id')->toArray();
})
->required(),
based on this input
Forms\Components\Select::make('streaming_bundle_id')
->label('Streaming Bundle')
->searchable()
->options(function () {
return \App\Models\StreamingBundle::all()->pluck('name', 'id')->toArray();
})
->required(),
Forms\Components\Select::make('streaming_bundle_id')
->label('Streaming Bundle')
->searchable()
->options(function () {
return \App\Models\StreamingBundle::all()->pluck('name', 'id')->toArray();
})
->required(),
12 replies
FFilament
Created by Suky on 3/28/2024 in #❓┊help
DateTimePicker Formatting
No description
4 replies