FilamentF
Filament3y ago
Finn

Filtering a Select field's options based on a parent relationship

I'm creating a form where I can create a new instance of a CompletedTrainingQualification, which uses a BelongsTo TrainingQualification relationship, which in turn BelongsTo a TrainingProvider.
My issue is that I would like to have a form that utilises a select box to select a provider, and then the value of training_qualification_id can be selected in a seperate select box (using the normal select relationship field in filament), where the options are only those which have a training_provider_id of the one selected.
I am open to achieving this is a different way too, but the main point is being able to select a qualification based off of the provider, where the provider is not stored on the CompletedTrainingQualification record when the form is submitted.
Grateful for any help, cheers.
Was this page helpful?