Closed makkinga closed 1 year ago
Nvm, while tinkering with my code I stumbled on this. Apparently, that's a thing and I can fix it like this:
BelongsTo::make(__('Group Parent'), 'variantOf', Product::class)
->required(true)
->hide()
->dependsOn('type', function (BelongsTo $field, NovaRequest $request, FormData $formData) {
if ($formData->type === 'variant') {
$field->show();
}
}),
Sorry for wasting your time! hopefully, this helps someone else reading this 😅
This is more a question than an actual issue. I have a
BelongsTo
field inside aDependencyContainer
that is not being populated. I can think of reasons why this happens, but I don't know if what I want is even possible with this setup or if I'm doing it wrong. I can't seem to find anything on this in the documentation.This is the code I'm using: