Issue
I have two versions of a site one running at on example.com and other at example.com/version2.
In web.php I have
Route::group(['middleware'=>['webconfig'],'prefix'=>'version2'], function(){
//Routes for version2 site
});
// Routes for main site
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
public function handle($request, Closure $next)
{
\Config::set('database.default', 'mysql_us');
\Config::set('app.url', url('version2'));
return $next($request);
}
So how can I set base url dynamicaly.
Solution
In your .env file specify APP_URL=http://example.com/version2
Answered By - Sergei Krivosheenko
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.