tenancy icon indicating copy to clipboard operation
tenancy copied to clipboard

Problem with InitializeTenancyByDomainOrSubdomain when domain is similar to central domain

Open jakobjp opened this issue 4 months ago • 2 comments

Bug description

Case using InitializeTenancyByDomainOrSubdomain

Central domain: tms.test Tenant 1 Subdomain: test1.tms.test Tenant 1 Domain: test1-tms.test (Does not work) Alternative Tenant 1 Domain: test1-tenant.test (Does work)

Conclusion: The tenant 1 domain test1-tms.test is very similar to the central domain tms.test. Could this be the reason why the test1-tms.test is not identified?

Image Image Image Image

Steps to reproduce

Fresh Laravel installation with Tenancy. Followed the Quick Start Guide (using Sail). And setup one tenant with domains like described above.

Expected behavior

I would expect any subdomain or domain to be identified. Also if it is similar to the central domain.

Laravel version

12

stancl/tenancy version

3

jakobjp avatar Sep 14 '25 07:09 jakobjp

I have tried the exact same setup and http://test1-tms.test/ is identified as it should be. Can you share the code?

kostamilorava avatar Sep 27 '25 14:09 kostamilorava

I have tried the exact same setup and http://test1-tms.test/ is identified as it should be. Can you share the code?

Okay, I have added it in this repo: https://github.com/jakobjp/laravel-tenancy-domains-test

jakobjp avatar Sep 29 '25 07:09 jakobjp