Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aurawindsurfing's avatar

Nova Dependent Filter - Dependent Dropdown

HI!

Did anyone figure out how to make dependent dropdown options based on a value of some other field while creating a model?

Lets say we select Country first, then we want dropdown to show us only Cities in a given country.

Thanks!

0 likes
4 replies
aurawindsurfing's avatar

Yeah I could not figure how to make dependency container for belong to field.

I'll have a look at the first one now!

aurawindsurfing's avatar

Thx a lot!

 NovaBelongsToDepend::make('Company')
                ->options(\App\Company::all()),

 NovaBelongsToDepend::make('Contact')
                ->optionsResolve(function ($company) {
                    return $company->contacts()->get();
                })
                ->dependsOn('Company'),

did the trick.

Please or to participate in this conversation.