Open bkintanar opened 6 years ago
Can you please give a bit more guidance? If I'm not wrong a hyn/multi-tenant application has 3 different connections: default (mysql), system and tenant.
When I run the auth() pages without setting the connection to tenant or system in auth.php, he can't find the users table. Should be the system and the default system be the same to avoid such behavior, or should we set the default connection always to system? How to do so?
Thank you.
@Nowi5 this package only suggest 2 database connection. System and Tenant db connection. Where is your users table located?
Yes this package add this two connection on top of laravel standard. So can't we merge system with laravel standard?
You can, it's up to you, most often it makes sense to set default
to system
.
And in the case of multiples User models? This solution works as well? I mean, if I have system and tenant users using different guards and providers form them
I have 0 experience with tenancy/multi-tenant
;
But in some experiments I did with multi-model authentication I came up with the following package. https://github.com/sniper7kills/multimodelauth
I can't promise it'll be a solution, or event help in this case, but it allowed me to have two different models, on two different connections, use a single guard for authentication. (in fact you'll likely just want to use that repo as an example, and implement a well tested solution in your own project)
Moved from hyn/multi-tenant#443
It's possible to force the password reset entries to be saved on the tenant connection. In order to do so update the
auth.php
file and add theconnection
key like this: