Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mikebolingbroke's avatar

Hyn Muti Tenacy / Multi Database

Hi All,

I have a project which at present works very well using multi tenancy, the App allows users to sign-up via a single registration page https://example.com/reg/. This creates a database and sub-domain for them. I have no issues with login from the multi tenancy side i.e https://subdown.example.com/login/ but i would like all users from all sub-sites to sign in from the https://example.com/login/ Does anyone have any ideas?

From my side im thinking about using the same standard laravel auth system x 2 but dependant on the domain structure, is this the right train of thought or is there an easier way?

Thanks

MB

0 likes
2 replies
Tray2's avatar

Then you need to have the user specify the subdomain on the login page to determine what subdomain you should log in to.

1 like
mikebolingbroke's avatar

Thanks for the reply Tray2, yes i was trying to get round that too. My idea so far is to add an additional table in the top core database which houses the subdomain urls. This table will log the users who have signed up just like within the subdomain database, then if they try to login it will find there subdomain via this table then log them in to there subdomain site? My issue with this is i'm duplicating data and if the user is deleted i need to delete them from both databases. Do you think i'm right in doing it this way?

Thanks for the help

Please or to participate in this conversation.