From 82677047a9551025e3c6df495fe707b466225967 Mon Sep 17 00:00:00 2001 From: Basvankempen Date: Tue, 8 Dec 2020 09:43:23 +0100 Subject: [PATCH 1/2] Configurable @responseFile path --- config/apidoc.php | 5 +++++ src/Extracting/Strategies/Responses/UseResponseFileTag.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/apidoc.php b/config/apidoc.php index 8ae737be..42658b87 100644 --- a/config/apidoc.php +++ b/config/apidoc.php @@ -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. */ diff --git a/src/Extracting/Strategies/Responses/UseResponseFileTag.php b/src/Extracting/Strategies/Responses/UseResponseFileTag.php index 007f4fc1..fa8f0de9 100644 --- a/src/Extracting/Strategies/Responses/UseResponseFileTag.php +++ b/src/Extracting/Strategies/Responses/UseResponseFileTag.php @@ -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'); } From 076eccee943e9764c12568612d434cf83341db6e Mon Sep 17 00:00:00 2001 From: Basvankempen Date: Mon, 25 Jan 2021 12:07:27 +0100 Subject: [PATCH 2/2] Change vendorname --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9249c973..11ea58cf 100644 --- a/composer.json +++ b/composer.json @@ -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": [