relatableQuery dependsOn belongsTo value #4897
-
Beta Was this translation helpful? Give feedback.
Answered by
crynobone
Nov 16, 2022
Replies: 1 comment
-
|
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]))
);
}
}), |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mrleblanc101
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Implemented in Nova 4.19.0
You can now do the following: