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.
Oh. This did not occur to me. I should probably be able to access the Config data in routes.php. thanks
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?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community