新增域名路由

This commit is contained in:
wuyanwen 2019-12-15 17:26:40 +08:00
parent aea9eb6a17
commit 27b30a8704

View File

@ -18,11 +18,20 @@ class LoadModuleRoutes
{ {
$router = app(Route::class); $router = app(Route::class);
$router->group(function () use ($router) { $domain = config('catch.domain');
foreach ($this->getRoutes() as $route) { if ($domain) {
include $route; $router->domain($domain, function () use ($router) {
} foreach ($this->getRoutes() as $route) {
}); include $route;
}
});
} else {
$router->group(function () use ($router) {
foreach ($this->getRoutes() as $route) {
include $route;
}
});
}
} }
/** /**