You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on a project that renders a checkbox, when ticked, it shows two Tag fields. Now what I'd like to do is, when the first Tag field is filled, I want the second Tag's options to reflect the choices I made in the first Tag field. Can this be done with Nova 4?
Boolean::make('Provider Level Access', 'provider_level_access')
->help('Enable access to selected facilities from the same provider'),
Tag::make('Selected Providers', 'selectedProviders', Provider::class)
->showCreateRelationButton(false)
->preload()
->dependsOn('provider_level_access', function (Tag $field, NovaRequest $request, $formData) {
if (!empty($formData['provider_level_access'])) {
$field->show();
} else {
$field->hide();
}
}),
Tag::make('Selected Facilities', 'selectedFacilities', ProviderFacility::class)
->showCreateRelationButton(false)
->preload()
->dependsOn(['provider_level_access', 'selectedProviders'], function (Tag $field, NovaRequest $request, $formData) {
if (!isset($formData['provider_level_access']) || !$formData['provider_level_access']) {
$field->hide();
return;
}
$field->show();
}),
So I'd like to conditionally populate selected facilities with values that make sense in my app, based on selected providers.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Working on a project that renders a checkbox, when ticked, it shows two Tag fields. Now what I'd like to do is, when the first Tag field is filled, I want the second Tag's options to reflect the choices I made in the first Tag field. Can this be done with Nova 4?
So I'd like to conditionally populate selected facilities with values that make sense in my app, based on selected providers.
Beta Was this translation helpful? Give feedback.
All reactions