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

theharisshah's avatar

Multiple Apps in single codebase.

I have a project with an admin dashboard and a web app on a single codebase separated by domain names and two different route files. They run perfectly in a local environment. Now I want to deploy them on shared hosting with Cpanel, which my client already has rented and is not ready to switch. Can someone help me with this or point me to some article or something. Thank you.

0 likes
3 replies
Tray2's avatar

If they will be using subdomains you can do this in your route files

Route::domain('soccer.myapp.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

That way https://soccer.myapp.comwould hit the routes defined under Route::domain('soccer.myapp.com') and https://football.myapp.com would hit the routes under Route::domain('fotball.myapp.com')

1 like
theharisshah's avatar

Would this work in a shared hosting environment? I already have multiple working domains of a single code base locally.

Tray2's avatar

Probably not if you have different domains like

  • soccer.com
  • football.com

and so on.

Then it would be one install per domain.

You could probably do some htaccess hacks to get it to reroute but I think that is a bad idea.

Please or to participate in this conversation.