protected function loadAuraRoutes($path)
{
if (!is_readable($path)) {
throw new \InvalidArgumentException('Invalid aura routes path found: ' . $path);
}
$router = (new AuraRouterFactory())->newInstance();
// The included file must return the aura router
$router = (include $path);
if (!$router instanceof AuraRouter) {
throw new \Exception('Invalid return value from ' . pathinfo($path, PATHINFO_FILENAME) . ' expected instance of AuraRouter');
}
foreach ($router->getRoutes() as $route) {
$route->addValues(array('_module' => $this->getName()));
}
return $router;
}