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 work
8 Replies
Jeff
Jeff10mo ago
Hmm. I'm wondering if this is solved. I'm going to come up against it soon.
Hotcat
Hotcat10mo ago
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.
noOne
noOne10mo ago
i'm using spatie multi tenancy package with filament and it is working without any issue
Martin Keck
Martin Keck9mo ago
Is the password resetting function working for you? That's the only thing which doesn't work with Spatie's multi tenancy
noOne
noOne9mo ago
didn't try it what is the problem exactly ?
Martin Keck
Martin Keck9mo ago
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
noOne
noOne9mo ago
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
Martin Keck
Martin Keck9mo ago
Ah ok, didn’t know that. It just confused me as logging in etc worked without problems. A PR would be great indeed