Skip to content
Discussion options

You must be logged in to vote

Implemented in Nova 4.19.0

You can now do the following:

BelongsTo::make('User')
  ->dependsOn('role', function ($field, $request, $formData) {
    if (! empty($formData->role)) {
      $field->relatableQueryUsing(
        fn ($request, $query) => $query->whereIn('id', [$form->role]))
      );
    }
  }),

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrleblanc101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Feature Request implemented Feature Request implemented
2 participants