Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mpociot/laravel-apidoc-generator",
"name": "basvkempen/laravel-apidoc-generator",
"license": "MIT",
"description": "Generate beautiful API documentation from your Laravel application",
"keywords": [
Expand Down
5 changes: 5 additions & 0 deletions config/apidoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
*/
'type' => 'static',

/**
* The base folder the response files are pulled from
*/
'reponseFileBasePath' => storage_path(),

/*
* Static output folder: HTML documentation and assets will be generated in this folder.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/Extracting/Strategies/Responses/UseResponseFileTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ protected function getFileResponses(array $tags)
$responses = array_map(function (Tag $responseFileTag) {
preg_match('/^(\d{3})?\s?([\S]*[\s]*?)(\{.*\})?$/', $responseFileTag->getContent(), $result);
$relativeFilePath = trim($result[2]);
$filePath = storage_path($relativeFilePath);
$filePath = storage_path();
if (config('apidoc.reponseFileBasePath')) {
$filePath = config('apidoc.reponseFileBasePath');
}
$filePath = $filePath . DIRECTORY_SEPARATOR . $relativeFilePath;
if (! file_exists($filePath)) {
throw new \Exception('@responseFile ' . $relativeFilePath . ' does not exist');
}
Expand Down