Replies: 2 comments 4 replies
-
|
There are request that will create a new instance of Resource without fetching the model and this would make |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
I was able to make it work like this |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
We have a multi-tenant application, so within Nova we'd like for various fields to only pull from data belonging to the same company as the resource we're editing.
To do this, I have tried the following in our Nova Product resource. Product models have a
distributor_idproperty that defines which company they're for.When I load the Product resource within Nova, three log entries are written, but nothing displays in the drop-down for "Default Type"
It seems like, for whatever reason, on the final load all the model properties are missing, which results in the menu checking for a null ID instead of the actual ID. The documentation for
relatableQueryUsing()unfortunately only uses static data, so perhaps I'm just using this feature incorrectly, but the documentation makes no mention of how to factor in model properties so I was forced to guess.I was able to make this work by using the following, but this results in an extra database query that shouldn't be necessary based on my understanding of how Nova handles model properties.
Detailed steps to reproduce the issue on a fresh Nova installation:
Beta Was this translation helpful? Give feedback.
All reactions