orlyapps / nova-belongsto-depend

Larave Nova BelongsTo Field with Dependcy
MIT License
182 stars 65 forks source link

Not working #116

Closed parsampsh closed 2 years ago

parsampsh commented 2 years ago

I've add this to my resource and the "Locations" dropdown works correctly, but "Classrooms" do not get loaded when I select a location.

NovaBelongsToDepend::make('Location', 'location', Location::class)->options(\App\Location::all()),
NovaBelongsToDepend::make('Classroom', 'classroom', Classroom::class)
    ->optionsResolve(function ($location) {
        return $location->classrooms()->get();
    })->dependsOn('Location'),
parsampsh commented 2 years ago

Very very stupidly, after I submited this issue, it just got fixed :)))) I think it was a prank from the universe! Kidding, I ran "composer route:cache" and "composer dump-autoload" and it fixed!