Skip to content

Commit 3430758

Browse files
author
Alexander Obuhovich
committed
Fixes route urls building from Artisan for websites under sub-path
1 parent 23b8d99 commit 3430758

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ class SetRequestForConsole
1515
*/
1616
public function bootstrap(Application $app)
1717
{
18-
$app->instance('request', Request::create(
19-
$app->make('config')->get('app.url', 'http://localhost'), 'GET', [], [], [], $_SERVER
20-
));
18+
$uri = $app->make('config')->get('app.url', 'http://localhost');
19+
$components = parse_url($uri);
20+
$server = $_SERVER;
21+
22+
if (isset($components['path'])) {
23+
$server['SCRIPT_FILENAME'] = $components['path'];
24+
$server['SCRIPT_NAME'] = $components['path'];
25+
}
26+
27+
$app->instance('request', Request::create($uri, 'GET', [], [], [], $server));
2128
}
2229
}

0 commit comments

Comments
 (0)