-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Registration flow question #23
Comments
Hmm, I think I overlooked the simplicity of That said, still banging on correct syntax for the Artisan call...
|
Update. This seems to run properly: However, I now get this:
I have a tenant prefix of 'tenant_' on tenant databases. Does the Artisan command just look at $tenant->database perhaps, without adding prefix? Checking... Update. Tried inserting 'tenant_' . Str::uuid() instead of just UUID into Tenants db. Same error:
Update 2. Confirmed, also fails in console:
|
Ultimately, I think I tracked it down to a missing config setting. Didn't have the default connection set to 'tenant'. |
Hey @dambridge , how did you fix the My artisan call is pretty much exactly like yours: But I'm still getting: This is how my
|
Still working through this. This call works perfectly when I have it in a job (I have made all jobs tenant aware by default in the config). However... it fails when I run it in a controller directly with the same error! Very strange, still looking at it. |
If it works in my job, then something about environment/context must be at play is my thinking. Not sure if this is relevant, but found this in the MultiTenancy service provider:
Maybe this means the command is only available from within console? And because jobs run 'out of process' it works? |
This is greasy, but it works in controller: |
In the vendor of your app, move that |
After moving the |
In case anyone else experiences this issue in the future, this is how your should write the Artisan command:
|
Looks great, and so far so good. Cheers!
I've got an initial setup in which a user registers, a tenant is created and its db created. Wondering your thoughts on best approach to complete the process.
I'm thinking of dispatching a job for seeding the tenant database (using Artisan::call) like so:
and inserting the User. I understand I can make jobs tenant-aware, but my auth routes are outside the tenant subdomain. Can I still use makeCurrent() here somehow? Or do I need to manually pass the new Tenant Id directly to the job at this stage?
The text was updated successfully, but these errors were encountered: