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

ather's avatar
Level 1

Running multiple sites from a same code engine.

Hello.

We have an application with 50+ subscribers. It's a single-tenant app, which means every subscriber has its own separate Laravel installation, .env, config, crons (schedule:run, queue:work, etc) and database and they use different mailboxes to send their emails - single tenancy is a security requirement by the subscribers, and the instances never ever talk to each other.

The subscribers have their domain like first.domain.com, second.domain.com, and so on and so forth and each of these subdomains points to different directories in Nginx. All of these directories have exactly the same Laravel code.

I am looking for a way to power all subscribers from one Laravel installation so that we don't have to deploy and npm run prod on 50+ sites.

I have solved a similar problem in Yii where I kept the Yii code, composer, and npm in a separate directory and created symlinks in each subscriber's directory but it was ugly and I don't think is the right way of doing it in Laravel.

I know there are a few hints at the links below but I don't think they solve my issue. What is the best way to handle this in Laravel 6?

https://github.com/appstract/laravel-multisite/blob/master/README.md https://laracasts.com/discuss/channels/general-discussion/multiple-websites-built-on-one-laravel-framework

0 likes
3 replies
bugsysha's avatar

Maybe just to keep a portion of the app in the same database and the rest in separate databases dedicated per user. Is that an option?

ather's avatar
Level 1

Which portion are you referring to keep in the DB? I can respond better if you could elaborate a bit...

Also, "databases dedicated per subscriber" (vs "per user") is more accurate :) Just an FYI...

ather's avatar
Level 1

Anyone? Surprised to see no response to an issue I thought was pretty common...

Please or to participate in this conversation.