-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
registerAndActivate on a different connection doesn't work with config() #559
Comments
How are you setting the active database to be used? |
I am using config(“database.connection”) And then php artisan migrate and seed using —database= It all works but Sentinel doesn’t respect the database parameter |
The Artisan commands like So you need to really change the connection at runtime, unsure if modifying the config would suffice here, as you might need to call the |
The problem is setting default connection changes my main connection also. This interferes with creating tenant on the fly. I solved this by creating a new model with different connection and setting Sentinel to use this model. But Sentinel should really allow a connection parameter, that would be so much better |
You're more than welcomed to submit a pull request to allow that to be changed at runtime, just keep in mind that it needs to work with both native and framework implementations. |
I am creating and migrating databases on the fly, and have managed to successfully do this with seeding of data.
However, when it comes to seeding a user on this new db using Sentinel::registerAndActivate , Sentinel defaults back to the main connection and creates a user on that connection.
It doesn't respect the connection that I have specified for the new database via config('database.connection')
Is there a workaround for this?
The text was updated successfully, but these errors were encountered: