Home » Php » Laravel “project_name/public” is removed from URL when i add sub domain in route group

Laravel “project_name/public” is removed from URL when i add sub domain in route group

Posted by: admin October 26, 2017 Leave a comment

Questions:

I am trying to add sub domin for specific routes like this :

web.php:

Route::group(['domain' => 'subdomain.domain.com'], function() {
  Route::GET('login', ['as' => 'login.index', 'uses' => '[email protected]']);
});

the problem in the url it becomes like this “subdomain.domain.com/login”
it must be like this “subdomain.domain.com/projectname/public/login”

project_name/public is removed when i add domain in route group, this happens in local environment

Answers: