Replies: 2 comments
-
I would guess this related to Nova running queries without global scope. That's by design and you probably need to use |
Beta Was this translation helpful? Give feedback.
0 replies
-
Before using a tenat need initialize it by user or so. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
I am using a laravel app with Spatie's multi tenancy package. In my Eloquent models, I specify their "use UsesTenantConnection" trait to make the models use a tenant database instead of my landlord database. For my app's user resource on Nova, the UsesTenantConnection in my Eloquent model is being ignored and its still looking in my landlord database for the users table. I've looked around and at some other issues related to models not adhering to a specified connection, and also asked on forums, but I'm not getting an answer on this, so I'm wondering how I can make a model in Nova use a specific database connection?
Also, this issue does not occur on my other models, only on my User model, which is the one that I authenticate with.
The equavalent of what I'm trying to do would be specifying my database connection like this:
I've tried reading, but I can't find too much on how to manage multi tenancy when it comes to Nova. Is there a way to easily make my resources adhere to the tenancy rules that I'm using in my app?
Beta Was this translation helpful? Give feedback.
All reactions