Support the ongoing development of Laravel.io →
Configuration Requests Architecture
Last updated 2 years ago.
0

You could simply test the environment in your routes.php file then include the route file corresponding to the site.

if ($site1)
{
    include 'site1_routes.php';
}


if ($site2)
{
    include 'site2_routes.php';
}

Should work.

Last updated 2 years ago.
0

Oh. This did not occur to me. I should probably be able to access the Config data in routes.php. thanks

Last updated 2 years ago.
0

niteshn said:

I'm using a single laravel installation to run two websites (multisite). Most of the model and controller code is same, so it seemed logical to me to avoid duplication. I have just created separate view folders for both the websites.

I want to keep separate routes.php file for both the websites? How can I change which which routes files to read from when a certain environment variable is set?

Out of topic but still... how did you manage to make it multisite?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

niteshn niteshn Joined 20 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.