laravel 5.5 二级域名绑定问题
域名locallaravel55.com 指定的路径是pulic文件夹
二级域名:web.locallaravel55.com
app\Http\Controllers\Web\IndexController.php 对应下面路由:
Route::domain('{account}.' . env('DOMAIN', 'localhost'))->namespace('Web')->group(function () {
Route::get('/', 'IndexController@index');
});
二级域名:m.locallaravel55.com
app\Http\Controllers\Wap\IndexController.php对应下面路由:
Route::domain('{account}.' . env('DOMAIN', 'localhost'))->namespace('Wap')->group(function () {
Route::get('/', 'IndexController@index');
});
上面绑定二级域名不能区分到各个命名空间,各位大神怎么解决?坐等。。。。
1 Comment
@gxcnvip#1384
二级域名:web.locallaravel55.com
app\Http\Controllers\Web\IndexController.php 对应下面路由:
Route::group([
'domain' => 'web.locallaravel55.com',
'namespace' => 'Web',
],function ($router) {
Route::get('/', 'IndexController@index');
});
二级域名:m.locallaravel55.com
app\Http\Controllers\Wap\IndexController.php对应下面路由:
Route::group([
'domain' => 'm.locallaravel55.com',
'namespace' => 'Web',
],function ($router) {
Route::get('/', 'IndexController@index');
});
搞定