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

Asser90's avatar

Multidomain App - Register only to one domain?

Hi there.

So im basically working on a site that works like an "webapp". It consist of multiple quizzes, courses and lessons. However im making it as one site utilizing the domain routing.

This means i can choose what the different domains can access, and i dont need multiple db's. Im able to admin everything from one site.

My users visit this "app" by going to app.domain1.com, app.comain2.com etc.

My main problem now is im not sure about the auth part.

I allready have standard make:auth working however this makes you able to access app. on all domains.

However i was thinking on limiting accounts to the domain it registered to.

Anyone knows of a good idea to do this?

0 likes
1 reply
bobbybouwmann's avatar

Well, I think you need to connect the user to the domain and then make a middleware for that so you can check if the logged in user is connected to the current domain.

So a one-to-one relationship or maybe a one-to-many for users that are connected to multiple domains?

Is that what you're after?

Please or to participate in this conversation.