Skip to content
Advertisement

set base URL dynamicaly in Laravel 5

I have two versions of a site one running at on example.com and other at example.com/version2.

In web.php I have

JavaScript

In webconfig middleware I set database connection for version2 site. Which is working fine but I am also setting base URL for version2 site. which not working url() method returns example.com Here is my webconfig middleware

JavaScript

So how can I set base url dynamicaly.

Advertisement

Answer

In your .env file specify APP_URL=http://example.com/version2

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement