新增域名路由

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->group(function () use ($router) {
foreach ($this->getRoutes() as $route) {
include $route;
}
});
$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) {
foreach ($this->getRoutes() as $route) {
include $route;
}
});
}
}
/**