$json = $swagger->getResource($resourceName, $resourceOptions);
$resourceName = str_replace(DIRECTORY_SEPARATOR, '-', ltrim($resourceName, DIRECTORY_SEPARATOR));
$output[$resourceName] = $json;
}
$filename = $docDir . '/api-docs.json';
file_put_contents($filename, Swagger::jsonEncode($resourceList, true));
foreach ($output as $name => $json) {
$name = str_replace(DIRECTORY_SEPARATOR, '-', ltrim($name, DIRECTORY_SEPARATOR));
$filename = $docDir . '/' . $name . '.json';
file_put_contents($filename, $json);
}
}
}
if (Config::get('swagger.behind-reverse-proxy')) {
$proxy = Request::server('REMOTE_ADDR');
Request::setTrustedProxies(array($proxy));
}
Blade::setEscapedContentTags('{{{', '}}}');
Blade::setContentTags('{{', '}}');
//need the / at the end to avoid CORS errors on Homestead systems.
$response = response()->view('swagger::index', array('secure' => Request::secure(), 'urlToDocs' => url(Config::get('swagger.doc-route')), 'requestHeaders' => Config::get('swagger.requestHeaders')));
//need the / at the end to avoid CORS errors on Homestead systems.
/*$response = Response::make(
View::make('swaggervel::index', array(
'secure' => Request::secure(),
'urlToDocs' => url(Config::get('swaggervel.doc-route')),
'requestHeaders' => Config::get('swaggervel.requestHeaders') )
),
200
);*/
if (Config::has('swagger.viewHeaders')) {