新增域名路由

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

View File

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