Skip to content
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

[Question] Tenants with custom domain #37

Closed
asivaneswaran opened this issue Jun 4, 2020 · 3 comments
Closed

[Question] Tenants with custom domain #37

asivaneswaran opened this issue Jun 4, 2020 · 3 comments

Comments

@asivaneswaran
Copy link

Hi,

I looked into your package and it's amazing by the way. I was wondering how you would suggest handling clients with their own domain name? How can we figure out the current tenant?

@ammadeuss
Copy link

ammadeuss commented Jun 5, 2020

“ The package ships with a DomainTenantFinder that will make the tenant active who’s domain attribute value matches the host of the current request.”

from https://docs.spatie.be/laravel-multitenancy/v1/installation/determining-current-tenant/

@asivaneswaran
Copy link
Author

Sorry, it might not have been clear.

I know it can detect: site1.website.com, site2.website.com, etc. But what if there is some sites that site1.com and site2.com?

@vincenzoraco
Copy link

The DomainTenantFinder class will get the full domain by default (see https://docs.spatie.be/laravel-multitenancy/v1/basic-usage/automatically-determining-the-current-tenant/) using $request->getHost() which returns the full domain including any subdomains, so if your user is using a custom domain, set the $user->domain to custom.com instead of user.yourdomain.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants