generator = new DingoGenerator(); } public function createRoute(string $httpMethod, string $path, string $controllerMethod) { $route = null; /** @var Router $api */ $api = app(Router::class); $api->version('v1', function (Router $api) use ($controllerMethod, $path, $httpMethod, &$route) { $route = $api->$httpMethod($path, TestController::class."@$controllerMethod"); }); return $route; } }