RelatableQuery understanding
I am trying to filter out a belongsTo relationship field with only the addresses related toy user model. I am in the resource file trying to use a relatableQuery to filter the drop-down to only show addresses related to the user I am creating a project for, but I am not having any success. I can get the query to work if I use the URL vatiable viaResourceId from my $request variable but then it doesn't work on the edit page. What am I missing?
I have added this code in Nova\Address resource
public static function relatableQuery(NovaRequest $request, $query) { return $query->where('user_id', $request->viaResourceId); }
This works on the create page if the user is preselected via the relationship but not on my edit page or if I create a project directly from the resource page.
Thanks for any help!
Please or to participate in this conversation.