Multi-tenancy by subdomain
Hi. I tried to do multi-tenancy but failed. Is there any easy way to switch between tenancy subdomain, not by url? Example:
Currently url to get tenancy: http://app.local/panel/workspace
Expected: http://workspace.app.local/panel
I tried use function domain in panel (
->domain('{tenancy:slug}.app.local')
) but it doesn't work8 Replies
Hmm. I'm wondering if this is solved. I'm going to come up against it soon.
Tenancy for Laravel
Automatic & flexible multi-tenancy package for Laravel.
Automatically turn any Laravel application multi-tenant — no code changes needed. stancl/tenancy automatically switches database connections and all other things in the background, letting you leverage standard Laravel code into a full SaaS application. Most features out of all multi-tenancy packages. Single & multi-database tenancy.
i'm using spatie multi tenancy package with filament and it is working without any issue
Is the password resetting function working for you? That's the only thing which doesn't work with Spatie's multi tenancy
didn't try it
what is the problem exactly ?
We are using a multi database setup and when a user requests a password reset the query for the password reset token is done on the landlord database instead of the tenant database, which fails of course, because the landlord db doesn’t include that table
it makes sense
but this is a laravel related issue so the fix should be in laravel
laravel doesn't have a way to customize the database connection of the password reset functionality
maybe i can submit a PR for this
Ah ok, didn’t know that. It just confused me as logging in etc worked without problems. A PR would be great indeed